0

The prompt do not open

When I finish the code and click for running it, the prompt just open and immediately exit, I unistalled and reinstaled, but continue the same way. I downloaded some exemples programs and it runs correctly, I did the code exatly as says in the lessons

16th Jan 2018, 1:36 AM
Cristofer
Cristofer - avatar
6 ответов
+ 7
Can you post the code? so we can check. I checked, the prompt is working for the following Python code. https://code.sololearn.com/cl5DbEKWmsS5/?ref=app
16th Jan 2018, 3:13 AM
Lord Krishna
Lord Krishna - avatar
+ 6
You are using python 2 you should be using the latest which is python 3. The code you have given is working fine in python 3 What's the error? Maybe download the latest version of python3 or try removing the parenthesis from print statements there are some differences between python 2 & python 3 I tested it even on Sololearn for the following input it is working correctly add 1 2 Quit Below is your code pasted in CPG https://code.sololearn.com/cmt9VgocgQy1/?ref=app
17th Jan 2018, 11:10 AM
Lord Krishna
Lord Krishna - avatar
+ 6
What's the error you get when running your calc code? Give a brief info then someone else can help you better.
17th Jan 2018, 2:37 PM
Lord Krishna
Lord Krishna - avatar
+ 1
okay, i'm new, I did the calculator as in the "a simple calculator", I just did some new operations, this is what i did: while True: print("Calculator") print("Options") print("Add") print("Subtract") print("Multiply") print("Divide") print("Potence") print("Squared Root") print("Quit program") user_input= input(":") if user_input == "Quit": break elif user_input == "add": num1=float(input("Enter a number: ")) num2=float(input("Enter a number: ")) result=str(num1 + num2) print(result) elif user_input == "Subtract": num1=float(input("Enter a number: ")) num2=float(input("Enter a number: ")) result=str(num1 - num2) print(result) elif user_input == "Multiply": num1=float(input("Enter a number: ")) num2=float(input("Enter a number: ")) result=str(num1 * num2) print(result) elif user_input == "Divide": num1=float(input("Enter a number: ")) num2=float(input("Enter a number: ")) result=str(num1 / num2) print(result) elif user_input == "Potence": num1=float(input("Enter a number: ")) num2=float(input("Enter a number: ")) result=str(num1 ** num2) print(result) elif user_input == "Squared Root": num1=float(input("Enter a number: ")) result=str(num1 **1/2) print(result)
16th Jan 2018, 4:14 PM
Cristofer
Cristofer - avatar
0
my version of the python is the 2.7.14 for 64 bits, I downloaded some codes for exemple, but it works normal, but any of the mine do not work
16th Jan 2018, 6:39 PM
Cristofer
Cristofer - avatar
0
I downloaded the 3.2.5 and continues not running, I tried to download the 3.6 and 3.5 but it is not downloadind, the 3.0 also not work
17th Jan 2018, 2:30 PM
Cristofer
Cristofer - avatar