Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am the bot that Sue created.")
- print("Let's get started.")
- users_name=input("What is your name? ")
- print("Welcome "+users_name)
- addsub=input("Please press a if you would like to add, s if you would like to subtract, m if you would like to multiply, d if you would like to divide. or v if you would like to calculate the average >")
- if addsub=="v" or addsub=="V" or addsub=="mean" or addsub=="Mean"or addsub=="average" or addsub=="Average":
- how_many=input("How Many Numbers >")
- how_many=int(how_many)
- total=0
- for number_count in range(how_many):
- number=input("Enter number "+str(number_count)+"> ")
- total = total + int(number)
- result=total/how_many
- print("The average ="+str(result))
- else:
- input1=input("Number 1> ")
- input2=input("Number 2> ")
- number1=int(input1)
- number2=int(input2)
- if addsub=="a" or addsub=="A" or addsub=="plus" or addsub=="Plus" or addsub=="add" or addsub=="Add":
- result=number1+number2
- output=str(result)
- print(input1+"+"+input2+"="+output)
- elif addsub=="s" or addsub=="S" or addsub=="minus" or addsub=="Minus" or addsub=="subtract" or addsub=="Subtract":
- result=number1-number2
- output=str(result)
- print(input1+"-"+input2+"="+output)
- elif addsub=="m" or addsub=="M" or addsub=="times" or addsub=="Times" or addsub=="multiply" or addsub=="Multiply":
- result=number1*number2
- output=str(result)
- print(input1+"*"+input2+"="+output)
- elif addsub=="d" or addsub=="D" or addsub=="divide" or addsub=="Divide":
- result=number1/number2
- output=str(result)
- print(input1+"/"+input2+"="+output)
- else:
- print(addsub+" is not a valid answer. I do not know if I should add, subtract, multiply, divide, or take an average. Please Try again.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement