Random Number Game
Hey guys,
Working on some python and some guys in irc said i should write a random number game to practice my python skills.. What a piece of cake i thought, i wrote this in about 5 minutes: Code:
import random Code:
Choose a number between 1 and 10: 5 Any ideas why its producing this logical error? |
I don't know python so I'm not sure if I will be right or even on the right track, but could it possibly be because when you enter into the keyboard it sends a charactor not a number? Maybe you need to convert the input to an integer?
In C, the value of the 5 you type into your keyboard is actually 35 (i think! :P), as it is just 5, the charactor, not the number, unless you specifically look for an integer from input it will be taken as a charactor.. Maybe your problem is with this? Like I said, i don't know python.. but just trying to help! |
http://honors.montana.edu/~jjc/easyt...00000000000000
I found this link to satisfy my curiosity :) Hope it helps! |
aha! thats it.. genius!
lol.. alright cool, glad i got that figured out. Thanks |
Any time mate :)
|
All times are GMT -5. The time now is 09:11 AM. |