crzcas

function in python

Dec 5th, 2020 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. def sum_2_numbers():
  2.     input0 = input("What is your name? ")
  3.     print("Hello " + input0 + " lets add two numbers")
  4.     input1 = input("Number 1> ")
  5.     input2 = input("Number 2> ")
  6.     number1 = float(input1)
  7.     number2 = float(input2)
  8.     result = number1 + number2
  9.     output = str(result)
  10.     print(input1 + " + " + input2 + " = " + output)
  11.     print("Bye for now " + input0)
  12.  
  13. sum_2_numbers()
  14. sum_2_numbers()
Advertisement
Add Comment
Please, Sign In to add comment