Skip to content

Instantly share code, notes, and snippets.

@avielb
Created March 19, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avielb/079981384aa2f7249bf6ceba54b73cbd to your computer and use it in GitHub Desktop.
Save avielb/079981384aa2f7249bf6ceba54b73cbd to your computer and use it in GitHub Desktop.
# define a function that it's input is 2 variables
# the function will return the sum of two numbers
def add_numbers(first_number, second_number):
return first_number + second_number
# input for two numbers, we will ask for input and cast the numbers
x = int(input("enter first number: "))
y = int(input("enter second number: "))
# get result of adding the two numbers
result = add_numbers(x, y)
# print the result
print("addition result is: " + str(result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment