Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer

From 811 to 820 of 820

Q. What is the type of sys.argv?

a. set

b. list

c. tuple

d. string

  • b. list

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

  • c. the program’s name

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

  • a. identifier followed by an equal to sign and the default value

Q. Where are the arguments received from the command line stored?

a. sys.argv

b. os.argv

c. argv

d. none of the mentioned

  • a. sys.argv

Q. f1()

a. error

b. 12

  • c. 15 d) 1512

Q. ,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

  • c. 10 20 30 40

Q. (1,2) print(total)

a. error

b. 7

c. 8

d. 15

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

  • d. the global variable is shadowed
Subscribe Now

Get All Updates & News