Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python calculator

print("Python Calculator")
problem = input("Enter a math problem, or 'q' to quit") # Takes User's input
while (problem != "q", "Q"): # If problem = "q", or "Q", quit
    print("The answer to ", problem, "is:", eval(problem)) # Solve problem
    problem = input("Enter another math problom, or 'q' to quit: ") # Repeat question
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Python #calculator
ADD COMMENT
Topic
Name
6+5 =