Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. How are variable length arguments specified in the function heading?
a. one star followed by a valid identifier
b. one underscore followed by a valid identifier
c. two stars followed by a valid identifier
d. two underscores followed by a valid identifier
Q. Which module in the python standard library parses options received from the command line?
a. getopt
b. os
c. getarg
d. main
Q. What is the value stored in sys.argv[0]?
a. null
b. you cannot access it
c. the program’s name
d. the first argument
Q. How are default arguments specified in the function heading?
a. identifier followed by an equal to sign and the default value
b. identifier followed by the default value within backticks (“)
c. identifier followed by the default value within square brackets ([])
d. identifier
Q. Where are the arguments received from the command line stored?
a. sys.argv
b. os.argv
c. argv
d. none of the mentioned
Q. Which of the following data structures is returned by the functions globals() and locals()?
a. list
b. set
c. dictionary
d. tuple
Q. What happens if a local variable exists with the same name as the global variable you want to access?
a. error
b. the local variable is shadowed
c. undefined behavior
d. the global variable is shadowed