Solved

The Following Is a Program Segment and the Definition of a Function

Question 38

Short Answer

The following is a program segment and the definition of a function named sub.
..X=3; def sub(Y):sub(X)Y=5; print (X);..\begin{array} { l r } .\\.\\\mathrm { X } = 3 ; & \text { def } s u b ( Y ) : \\\operatorname { sub } ( \mathrm { X } ) & \mathrm { Y } = 5 ; \\\text { print } ( \mathrm { X } ) ; &\\.\\.\end{array}
A. What value will be printed by the program segment if parameters are passed by value?
____________
B. What value will be printed by the program segment if parameters are passed by reference?
____________

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions