Week 3 Sample Program

posted Oct 21, 2016, 8:05 AM by Attila Lengyel
first = int(input("Give me a number:"))
second = int(input("Give me a second number:"))

print("The first number is ", first,". The second is ", second)

summ = first + second
print("Their sum is:", summ)

sign = input("Give me a +, -, * or /:")

if sign == "+":
print (first + second)
elif sign == "-":
print (first - second)
elif sign == "*":
print (first * second)
elif sign == "/":
print (first / second)
else:
print("Are you sure you know math?")


answer = input("How was the class today?")
if (answer == "OK"):
print("Sure...")
elif(answer == "Good"):
print("Excellent!")
elif(answer == "Horrible"):
print("I'm sorry, I will do better next time!")


Comments