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

From 541 to 555 of 820

Q. d["john"]

a. 40

b. 45

c. “john”

d. “peter”

  • a. 40

Q. >>>2 * t

a. (1, 2, 1, 2)

b. [1, 2, 1, 2]

c. (1, 1, 2, 2)

d. [1, 1, 2, 2]

  • a. (1, 2, 1, 2)

Q. >>>t1 < t2

a. true

b. false

c. error

d. none

  • b. false

Q. >>>print len(my_tuple)

a. 1

b. 2

c. 5

d. error

  • d. error

Q. What is the data type of (1)?

a. tuple

b. integer

c. list

d. both tuple and integer

  • b. integer

Q. What type of data is: a=[(1,1),(2,4),(3,9)]?

a. array of tuples

b. list of tuples

c. tuples of lists

d. invalid type

  • b. list of tuples

Q. ,2,3

a. yes, this is an example of tuple unpacking. a=1 and b=2

b. yes, this is an example of tuple unpacking. a=(1,2) and b=3

c. no, too many values to unpack

d. yes, this is an example of tuple unpacking. a=1 and b=(2,3)

  • c. no, too many values to unpack

Q. Tuples can’t be made keys of a dictionary.

a. true

b. false

  • b. false

Q. Which of the following statements create a dictionary?

a. d = {}

b. d = {“john”:40, “peter”:45}

c. d = {40:”john”, 45:”peter”}

d. all of the mentioned

  • d. all of the mentioned

Q. Operators with the same precedence are evaluated in which manner?

a. left to right

b. right to left

c. can’t say

d. none of the mentioned

  • a. left to right

Q. What is the output of this expression, 3*1**3?

a. 27

b. 9

c. 3

d. 1

Q. Which one of the following has the same precedence level?

a. addition and subtraction

b. multiplication, division and addition

c. multiplication, division, addition and subtraction

d. addition and multiplication

  • a. addition and subtraction

Q. Which one of the following has the highest precedence in the expression?

a. exponential

b. addition

c. multiplication

d. parentheses

  • d. parentheses

Q. Which of these in not a core data type?

a. lists

b. dictionary

c. tuples

d. class

  • d. class
Subscribe Now

Get All Updates & News