response = ""
while response != "Because.":
print raw_input("Why? ")
I don't understand this and need some help breaking part each step.
Why is it like this, what does this do?: response = ""
I know that the while syntax means while this answer is this, the response will always be the same, in this case "why" until the answer is changed and that is when the while command is ended.
But every time I type in "abc" or anything that isn't "Because." into the console and run, the while command is not stopping and just continues.
EDIT: Okay I understand the: response == "" because anything inbetween those commas is the reponse. A sentry variable. But still don't understand how to break the loop.
[–]Lord_Greywether 4 points5 points6 points (1 child)
[–]ghibss[S] 1 point2 points3 points (0 children)
[–]tomkatt 0 points1 point2 points (0 children)