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

From 451 to 465 of 820

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

  • a. one star followed by a valid identifier

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. san(12)

a. 13

b. 10

c. 2

d. 5

  • a. 13

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

Q. print(a)

a. 10

b. 25

c. junk value

d. error

  • b. 25

Q. f() x

a. error

b. 4

c. junk value

d. 1

Subscribe Now

Get All Updates & News