Question
def f(p, q, r):
global s
p = 10
q = 20
r = 30
s = 40
print(p,q,r,s)
p,q,r,s = 1,2,3,4
f(5,10,15)
a.
1 2 3 4
b.
5 10 15 4
c.
10 20 30 40
d.
5 10 15 40
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of the code shown below?
Similar Questions
Discover Related MCQs
Q. Which of the following data structures is returned by the functions globals() and locals()?
View solution
Q. On assigning a value to a variable inside a function, it automatically becomes a global variable. State whether true or false.
View solution
Q. Which is the most appropriate definition for recursion?
View solution
Q. Only problems that are recursively defined can be solved using recursion. True or False?
View solution
Q. Which of these is not true about recursion?
View solution
Q. In _______________ copy, the base address of the objects are copied.
In _______________ copy, the base address of the objects are not copied.
View solution
Q. The nested list undergoes shallow copy even when the list as a whole undergoes deep copy. State whether this statement is true or false.
View solution
Q. What happens if a local variable exists with the same name as the global variable you want to access?
View solution
Q. ______________ returns a dictionary of the module namespace.
________________ returns a dictionary of the current namespace
View solution
Q. Which of these is false about recursion?
View solution
Q. What is tail recursion?
View solution
Q. Which of the following statements is false about recursion?
View solution
Q. Recursion and iteration are the same programming approach. True or False?
View solution
Q. What happens if the base condition isn’t defined in recursive programs?
View solution
Q. Fill in the blanks:
In ____________________ copy, the modification done on one list affects the other list.
In ____________________ copy, the modification done on one list does not affect the other list.
View solution
Q. What is the base case in the Merge Sort algorithm when it is solved recursively?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!