CSC 112-Quiz 3B Dr. Assadipour 1. What is the output of the following program? 1
ID: 3733731 • Letter: C
Question
CSC 112-Quiz 3B Dr. Assadipour 1. What is the output of the following program? 1 def main 2 x 1 3 y 3.4 4 print('Before: ', x, ', y) 5 change_us(x, y) 6 print('inAfter: ', x,'It', y) 7 def change us(a, b): Your answer: a=0 b=0 print('InNow:"Ja =, ', a,'t6-, b) 10 11 main0 2. What is the output of the following program?Explanation / Answer
Output : Before 1 3.4 Now 0 0 After 1 3.4 Explanation: We are passing by value. So any change in actual argument will not affect the formal argument. Before 1 3.4 => We print the local variable Now 0 0 => Now, it will print value 0 and 0 Once we come back from function, any change in the function will not affect the actual argument. After 1 3.4 Thanks, let me know if there is any concern.