This article has been dead for over six months: Start a new discussion instead

## Featured Replies in this Discussion

- by pyTony

1

You break out of loop without calculations and you have problem with syntax. If you use input in Python2 you can just input the calculation normally 3.234 + 23.12312 as it runs the expression through eval. It is not so safe though, so use raw_input allways:

```
while True:
print "Welcome to Jakes' Calculator"
print "1) addition"
print "3) multiplication"
print "0) quit"
choice = raw_input("Enter the number: ").strip()
if choice == "1":
a = float(raw_input("enter the first number: "))
b = float(raw_input("enter the second number: "))
c = a + b
print a, "plus", b, "equals", c
elif choice == "3":
a = float(raw_input("enter the first number: "))
b = float(raw_input("enter the second number: "))
c = a * b
print a, "times", b, "equals", c
elif choice != "0" :
print "Not valid input"
else:
break
print
```

You