How can I make all this code from the IDLE editor window to Python shell window

How can I make all this code from the IDLE editor window to Python shell window
0
#1

Hello, my name is Ella, I’m a beginner in coding. I have a question ask for help on Python.

Why doesn’t work in the shell window after I select all of the coding in the IDLE editor window and press F5 to run? it doesn’t show any syntax error detail as well, pls help to figure out what’s wrong, thank you very much!

0 Likes

#2

Your function has been initialized but is not called. Try adding do_guess_round() at the end of your script (outside of the function) and then running it.

As soon as the correct number is guessed, the script will end and the shell will close. You might consider putting a “play again” option as an input where the user can enter Y or N. with an if statement you can either generate a new random number and run the function again, or close the shell with break

Is there a particular reason you decided to start learning python 2 and not python 3?

0 Likes

#3

Thanks for your reply, but the problem still cannot be solved. :thinking:
I was guided by a book that it teach python2, so now I’m learning 2 instead 3.

0 Likes