1. print() function returns None, so if initial guess is incorrect, in the body of while loop you assign None to num.
2. You don't want print, you want input, like in line 4. Also apply the conversion to int.
as a side note
1. Please, always post the entire traceback that you get. We need to see the whole thing. Do not just give us the last line.
Take a time to read What to include in a post
2. as alternative to converting user input to int every time, you can convert the randomnum to str once
2. You don't want print, you want input, like in line 4. Also apply the conversion to int.
as a side note
1. Please, always post the entire traceback that you get. We need to see the whole thing. Do not just give us the last line.
Take a time to read What to include in a post
2. as alternative to converting user input to int every time, you can convert the randomnum to str once
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs