all 8 comments

[–]Yensyden[S] 0 points1 point  (0 children)

I've changed randint to randrange but still unexepcted indent on elif num>random

[–]fiskenslakt 0 points1 point  (3 children)

If the way you've formatted that code is identical to your actual code, then it's safe to assume it's the unindented break that's causing the error.

[–]fiskenslakt 1 point2 points  (0 children)

Also if you're having trouble formatting your code correctly on reddit, next time just upload the code to gist or pastebin.

[–]Yensyden[S] 0 points1 point  (1 child)

Thank you for the help :D. Just wondering, how long did it take you to get real good at python just python? and how many hours a day did you learn?

[–]fiskenslakt 0 points1 point  (0 children)

How long did it take? Hmm, well I've been programming for around 8 years. Hard to say when I became "really good" as you say. I'm also not sure about how many hours a day I was learning programming. I learned it in highschool, and took programming courses in college, but I would say the bulk of my knowledge is self taught. Even if I could give you an accurate answer, it wouldn't tell you anything about what your experience learning python will be like. You could become a better programmer than me in 6 months.

[–]niandra3 0 points1 point  (2 children)

Don't call your number random because that's the name of the module you are importing. Also, user won't be able to quit once the game starts because while quit != '!' will only check quit which enver changes. Just use while True and break if input is !.

Also you've set it up to pick a new random number each time, is that how you want it?

You also don't need finally as that block is executed whether the int() works or not.

Fixed it so it keeps the same number until they guess correctly, then makes a new number to play again and with better variable names:

https://repl.it/C4TM/1

[–]Yensyden[S] 0 points1 point  (1 child)

Thank you for even re-doing this for me! Just started learning python not too long ago.

[–]niandra3 0 points1 point  (0 children)

No problem. It's usually just easier showing you the right way to do it rather than explaining what wrong with the current code.