#What is the output of the Python program below. (Note: This program works as expected) #************************************* # Exam Two Program #************************************* pear = 7 peach = 8 #************************************* # Function: main #************************************* def main(): apple = 4 orange = 5 if apple + pear <= orange : print("One,", end='') print("Two and Three") while orange >= 0 : print(orange, "***") orange = orange - 2 print(apple, pear, peach, "BEFORE FUNCTION") retVar = ExamTwoFunction(apple) print(peach, pear, retVar, "AFTER FUNCTION") # End of the Main Function #************************************* # Function: ExamTwoFunction #************************************* def ExamTwoFunction(banana): global pear pear = 10 banana = 12 peach = 14 print(banana, pear, peach, "INSIDE FUNCTION") return peach + banana # End of ExamTwoFunction main()
#What is the output of the Python
#*************************************
# Exam Two Program
#*************************************
pear = 7
peach = 8
#*************************************
# Function: main
#*************************************
def main():
apple = 4
orange = 5
if apple + pear <= orange :
print("One,", end='')
print("Two and Three")
while orange >= 0 :
print(orange, "***")
orange = orange - 2
print(apple, pear, peach, "BEFORE FUNCTION")
retVar = ExamTwoFunction(apple)
print(peach, pear, retVar, "AFTER FUNCTION")
# End of the Main Function
#*************************************
# Function: ExamTwoFunction
#*************************************
def ExamTwoFunction(banana):
global pear
pear = 10
banana = 12
peach = 14
print(banana, pear, peach, "INSIDE FUNCTION")
return peach + banana
# End of ExamTwoFunction
main()

Trending now
This is a popular solution!
Step by step
Solved in 6 steps









