Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am your mathbot")
- my_name=input("What's your name? ")
- print("Nice meeting you, "+my_name)
- operation=input("Would you like to practice addition/subtraction/multiplication/division? Enter A or S or M or D : ")
- if (operation=="A" or operation=="a"):
- num1=int(input("Enter the first number "))
- num2=int(input("Enter the second number "))
- result= num1+num2
- print(str(num1) + "+" +str(num2)+ "="+ str(result))
- elif(operation=="S" or operation=="s"):
- num1=int(input("Enter the first number "))
- num2=int(input("Enter the second number "))
- result= num1-num2
- print(str(num1) + "-" +str(num2)+ "="+ str(result))
- elif(operation=="M" or operation=="m"):
- num1=int(input("Enter the first number "))
- num2=int(input("Enter the second number "))
- result= num1*num2
- print(str(num1) + "*" +str(num2)+ "="+ str(result))
- elif(operation=="D" or operation=="d"):
- num1=int(input("Enter the first number "))
- num2=int(input("Enter the second number "))
- result=float( num1/num2)
- print(str(num1) + "/" +str(num2)+ "="+ str(result))
- else:
- print("Let's pratice math some other time. Bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement