Update my_first_calculator.py

This commit is contained in:
harshit720 2019-10-05 12:43:44 +05:30 committed by GitHub
parent a7aabeaf49
commit 2b5f1ed817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,9 +6,9 @@ if 3/2 == 1: # Because Python 2 does not know maths
print('Welcome to this calculator!')
print('It can add, subtract, multiply and divide whole numbers from 0 to 50')
num1 = int(input('Please choose your first number: '))
num1 = eval(input('Please choose your first number: '))
sign = input('What do you want to do? +, -, /, or *: ')
num2 = int(input('Please choose your second number: '))
num2 = eval(input('Please choose your second number: '))
if num1 == 0 and sign == '+' and num2 == 0:
print("0+0 = 0")