You need to put min_num and max_num in the global scope, i.e not inside a function.
|
Python
Trying to make a &[b]#34[/b];guess the number&[b]#34[/b]; game, why doesn't this work? |
(Oct 12, 2013 12:59 PM)monkeytherat Wrote: It's better form to pass them as parameters and define them in the game function. There are hundreds of ways to improve the code, he just told OP what needed to be done to get the error to go away. (Oct 14, 2013 01:22 AM)BeerMonger Wrote: question, what does that "chance()" refer to? LOL good catch, I didn't see that. That would also cause a problem, after his other one. (Oct 14, 2013 01:47 AM)BeerMonger Wrote: ... Why would you do that? Then you can't compare the two numbers, because they will be strings. (Oct 14, 2013 02:05 AM)BeerMonger Wrote: Can you add ints to a string just like that? using "+"? No that doesn't work, you'd have to convert to one data type, or another. (Oct 14, 2013 02:19 AM)BeerMonger Wrote: So I was right..You do need to convert them to strings then back to ints.. What part are you talking about? I'm confused. |
|
|
