0
PYTHON GHETTO CALCULATOR
can someone tell me whatâs wrong here? I need to make âProcessâ be a a string stored value by the users. I tried taking the str() function out but still wonât run properly. Traceback (most recent call last): File "ForLoop.py", line 3, in <module> PROCESS=str(input("ENTER WHAT YOU WOULD LIKE TO DO (+,-,*,/,**,%):")) File "<string>", line 1 * ^ SyntaxError: unexpected EOF while parsing
4 Respostas
+ 1
you do not need the str() function anymore cz the PROCESS itself as a raw input is already a string. I guess thatâs why u got errors
0
I take it off and still get this:
Traceback (most recent call last):
File "ForLoop.py", line 3, in <module>
PROCESS=input("ENTER WHAT YOU WOULD LIKE TO DO (+,-,*,/,**,%):")
File "<string>", line 1
*
^
SyntaxError: unexpected EOF while parsing
0
are u sure this code resulted the error on line 1. iâve just run it and it works TOTALLY fine. just check it. i think itâs bcz your previous input. if anything further, i wonât mind giving a hand
0
ENTERED_NUM= int(input("THIS IS QUICK MATHS..enter a number:"))
PROCESS=input("ENTER WHAT YOU WOULD LIKE TO DO (+,-,*,/,**,%):")
ENTERED_NUM2=int(input("enter second number:"))
if PROCESS=="+":
print(ENTERED_NUM+ ENTERED_NUM2)
elif PROCESS=="-":
print(ENTERED_NUM-ENTERED_NUM2)
elif PROCESS=="/":
print(ENTERED_NUM/ENTERED_NUM2)
elif PROCESS=="*":
print(ENTERED_NUM* ENTERED_NUM2)
elif PRCOESS=="**":
print(ENTERED_NUM** ENTERED_NUM2)
elif PROCESS=="%":
print(ENTERED_NUM% ENTERED_NUM2)