Question
#mod1
def change(a):
b=[x*2 for x in a]
print(b)
#mod2
def change(a):
b=[x*x for x in a]
print(b)
from mod1 import change
from mod2 import change
#main
s=[1,2,3]
change(s)
a.
[2,4,6].
b.
[1,4,9].
c.
[2,4,6].
[1,4,9].
d.
There is a name clash
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 following piece of code?
Similar Questions
Discover Related MCQs
Q. Which of the following isn’t true about main modules?
View solution
Q. Which of the following is not a valid namespace?
View solution
Q. Which of the following is false about “import modulename” form of import?
View solution
Q. Which of the following is false about “from-import” form of import?
View solution
Q. Which of the statements about modules is false?
View solution
Q. What is the order of namespaces in which Python looks for an identifier?
View solution
Q. Which of the following functions can be used to find the coordinated universal time, assuming that the datetime module has already been imported?
View solution
Q. The sleep function (under the time module) is used to:
View solution
Q. Which of the following functions helps us to randomize the items of a list?
View solution
Q. What is the interval of the value generated by the function random.random(), assuming that the random module has already been imported?
View solution
Q. Both the functions randint and uniform accept ____________ parameters.
View solution
Q. The randrange function returns only an integer value. State whether true or false.
View solution
Q. To obtain a list of all the functions defined under sys module, which of the following functions can be used?
View solution
Q. The output of the function len(sys.argv) is ____________
View solution
Q. Which of the following functions does not accept any arguments?
View solution
Q. Which of the following functions can accept more than one positional argument?
View solution
Q. Which of the following functions raises an error when an unpicklable object is encountered by Pickler?
View solution
Q. The pickle module defines ______ exceptions and exports _______ classes.
View solution
Q. Which of the following cannot be pickled?
View solution
Q. If __getstate__() returns _______________ the __setstate__() module will not be called on pickling.
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!