Page 2 of 4
FUNCTIONS & PROCEDURE
PROCEDURE example
(Mind the proper indentation, please arrange each line of code.)
#Procedure in Python:
def greet(name):
print("Hello, " + name + "!")
greet("Alice")
FUNCTION CALL example
(Mind the proper indentation, please arrange each line of code.)
# Function Call in Python that returns a value
def add_numbers(a, b):
return a + b
# This will return a value of the function call.
print("Please enter your first number: ")
a=int(input())
print("Please enter your second number: ")
b=int(input())
result = add_numbers(a, b)
print("\nThe result is: ", result)