Python on windows | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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)

2nd May 2021, 2:45 AM
Zachery Starks
Zachery Starks - avatar
3 Answers
+ 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
2nd May 2021, 3:02 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
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.
3rd May 2021, 7:09 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar
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
31st Aug 2021, 11:02 PM
⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀ - avatar