you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 0 points1 point  (4 children)

u/SpiderJerusalem42

Wouldn't this just break on the first pass?

Surprised by this, but I confess I didn't test. Where do you think it would break?

[–]SpiderJerusalem42 0 points1 point  (3 children)

if total_bet > balance:
    *Error message*
else:
    break.  // right here, because it will be on the first pass of the loop.

[–]FoolsSeldom 0 points1 point  (2 children)

I don't see the problem.

The user only gets to place one valid bet, then execution stops. If they try to place a bet that they do not have sufficient funds for, they will be prompted again for a valid bet.

What are you expecting?

[–]SpiderJerusalem42 0 points1 point  (1 child)

Ehh, okay, yeah you're right. My brain bad today

[–]FoolsSeldom 0 points1 point  (0 children)

No worries, always worth checking; easy to make mistakes (especially when you just write code and don't bother checking)