Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. What is a variable defined outside a function referred to as?
a. a static variable
b. a global variable
c. a local variable
d. an automatic variable
Q. What is a variable defined inside a function referred to as?
a. a global variable
b. a volatile variable
c. a local variable
d. an automatic variable
Q. If a function doesn’t have a return statement, which of the following does the function return?
a. int
b. null
c. none
d. an exception is thrown without the return statement
Q. What is the length of sys.argv?
a. number of arguments
b. number of arguments + 1
c. number of arguments – 1
d. none of the mentioned
Q. How are keyword 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. How many keyword arguments can be passed to a function in a single function call?
a. zero
b. one
c. zero or more
d. one or more
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