Ask coding questions

← Back to all posts
I need to break the loop so I can start asking questions. Paypal $5
BPChallenges (5)

I need to break the loop after signing up and logging in, so that I can ask the question "Would you like to choose the classical music quiz?"

Comments
hotnewtop
Axrevyn (291)

I think the problem is the if on line 51. You don't have it set to break after you log in successfully.
If you want, invite me, and I can help.

If it was helpful, marking this as the answer would make my day

Axrevyn (291)

@BPChallenges I fixed it.

My solution was:
(Line 11)

global logged_in

Declare logged_in as a global variable that I can use anywhere

(Line 23)

logged_in = True

Once you log in, the variable is now defined as True.

(Line 54)

if logged_in is True: break

This breaks from the loop only if you've successfully logged in.

Cool? Cool.
Marking this as the answer would make my day!

SorenRood (2)

Need two equal signs on line 42. == is the "check for equality" operator.

peternielsen112 (37)

Also I don't know what the "paypal $5" is but if you're putting a bounty on a question first off stack overflow does that if you want and tbh just google it man, not worth the $5

IcynDevz (762)

If you want to break a while loop, you need to do break

BPChallenges (5)

@IcingHackz could you do this for me?

IcynDevz (762)

@BPChallenges after login() and signup() add a break after it

BPChallenges (5)

@IcingHackz It says that it's outside the loop. Do you mean on the line after?

IcynDevz (762)

@BPChallenges wait can you let me edit the repl first

BPChallenges (5)

@IcingHackz Yes I've just accepted your request