Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # Interactive Python Calculator program.
  2. # Allows users to input a maths expression then prints out the answer.
  3. # Include in a loop to perform many equations.
  4.  
  5. def exercise11():
  6. calculate = True
  7. user_input = ""
  8.  
  9. while calculate == True:
  10. user_input = eval(input("Maths Expression: "))
  11.  
  12. if user_input == "":
  13. calculate = False
  14. else:
  15. print(user_input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement