The Student Room Group

Python people needed

I'm creating a game on python for Computer Science and I need help!!!
Basically, I have questions on there but if they get the question wrong twice in a row, the game is supposed to end. However, it doesn't, and instead it repeats the question. I can't break it because I haven't used a while loop and I don't know what to do .. Please help ASAP

Thanks
Reply 1
Okay, thanks I'll try that..
Original post by Mousey_.
I'm creating a game on python for Computer Science and I need help!!!
Basically, I have questions on there but if they get the question wrong twice in a row, the game is supposed to end. However, it doesn't, and instead it repeats the question. I can't break it because I haven't used a while loop and I don't know what to do .. Please help ASAP

Thanks


Noone is going to have any idea how to help you if they don't know what your code looks like (But don't paste code into TSR because it'll lose the formatting, and that won't be any use - the best way to put code on TSR would be a site like http://repl.it/languages/python3 instead).

In terms of general code troubleshooting, it'd be really beneficial for you to learn about how to set a break-point and user the debugger in whichever IDE / editor you're using

For example, here's a tutorial in the PyCharm environment: https://www.jetbrains.com/help/pycharm/debugging-your-first-python-application.html
Or for IDLE: https://www.cs.uky.edu/~keen/help/debug-tutorial/debug.html

The debugger is the most important and useful tool you'll ever learn for a programming language - it'll help you see how your program is running and check whether what's happening matches your expectations.
Reply 3
Original post by winterscoming
Noone is going to have any idea how to help you if they don't know what your code looks like (But don't paste code into TSR because it'll lose the formatting, and that won't be any use - the best way to put code on TSR would be a site like http://repl.it/languages/python3 instead).

In terms of general code troubleshooting, it'd be really beneficial for you to learn about how to set a break-point and user the debugger in whichever IDE / editor you're using

For example, here's a tutorial in the PyCharm environment: https://www.jetbrains.com/help/pycharm/debugging-your-first-python-application.html
Or for IDLE: https://www.cs.uky.edu/~keen/help/debug-tutorial/debug.html

The debugger is the most important and useful tool you'll ever learn for a programming language - it'll help you see how your program is running and check whether what's happening matches your expectations.

Thank you

Quick Reply

Latest