Advertisement
elena_gancedo

Functions_def

Jul 11th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. def intro():
  2.     print("Let's do some coding.")  
  3.     intro = input("If you want to add two numbers write 'add' or 'plus': ")
  4.     if intro == "add" or intro == "plus":
  5.        print("Let's add some numbers:")
  6.        input1 = input("Number 1> ")
  7.        input2 = input("Number 2> ")
  8.        number1 = int(input1)
  9.        number2 = int(input2)
  10.        result = number1 + number2
  11.        output = str(result)
  12.        print("The result of the sum: " + input1 + " + " + input2 + " = " + output)
  13.        print("That's all, bye.")
  14. intro()
  15. intro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement