Question: Type in the code below. Describe what is happening to the variables a and b . # - - - - - - - Main

Type in the code below. Describe what is happening to the variables a and b.
#------- Main Function ----------------------
def main():
a =3
b =7
function1(a)
print("After call to function1, A is: ", a)
b = function2(b)
print("After call to function2, B is: ", b)
#-------- Custom functions below--------------
def function1(a):
print("A is: ",a)
a = a +2
print("A is now: ", a)
a = a +5
def function2(b):
print("B is: ",b)
b = b *4
print("B is now: ", b)
return(b)
main() #this line needed at the bottom

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!