0
Python on windows
I just downloaded python on my laptop and Iâm still learning how to use everything but to see how it works I used a code from here on my laptop but it doesnât output results. Iâm confused on what I need to do different on Python on my laptop compared to here. I wrote the code the exact same way in both. shots = 4 score = 100 while shots > 0: result = input() if result == "hit": score +=10 shots -=1 elif result == "miss": score -=20 shots -=1 print(score)
3 RĂ©ponses
+ 2
If you have downloaded python from the official website then you must be using IDLE. Be sure you are using IDLE in EDITOR mode not SHELL.
To open in editor you have to just click on "new file" in "file" menu
0
I guess you are double clicking the PYTHON file
đ€Łđ€Łđ€Ł
If you are doing that then enter this at the end of your program.
input()
Or you should run your program from CMD or use ide or text editor like vscode.
0
i know im too late to be here
and u must have mastred python by now
but better 2 know for others
the problems is that the while loop never ends to reach that print :(
cuz print is out of the loop