What is the output of the program below? (Note: This program works as expected) #************************************* # Final Exam #************************************* pear = 7 peach = 8...



What is the output of the program below?  (Note: This program works as expected)


#*************************************
#  Final Exam
#*************************************


pear = 7
peach = 8


#*************************************
#  Function:  main
#*************************************
def main():
    banana = [1, 2, 3, 4, 5]


    print(banana, pear, peach, "BEFORE FUNCTION")


    FinalExamFunction(banana)


    print(banana, pear, peach, "AFTER FUNCTION")


# End of the Main Function


#*************************************
#  Function:  FinalExamFunction
#*************************************
def FinalExamFunction(apple):
    global pear


    pear = apple[0]
    apple[0] = apple[4]
    apple[4] = pear


    peach = apple[2]


    print(apple, pear, peach, "INSIDE FUNCTION")


# End of FinalExamFunction


main()
#End of Final Exam Program




Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here