Home / Engineering / Problem Solving and Python Programming MCQs / Page 28

# Problem Solving and Python Programming MCQs | Page - 28

Dear candidates you will find MCQ questions of Problem Solving and Python Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.

(A) [0]
(B) 0
(C) [0.00]
(D) error

(A) d.size()
(B) len(d)
(C) size(d)
(D) d.len()

## `Q. 273) print(list(d.keys()))`

(A) [“john”, “peter”]
(B) [“john”:40, “peter”:45]
(C) (“john”, “peter”)
(D) (“john”:40, “peter”:45)

## `Q. 274) Which of these about a dictionary is false?`

(A) the values of a dictionary can be accessed using keys
(B) the keys of a dictionary can be accessed using values
(C) dictionaries aren’t ordered
(D) dictionaries are mutable

## `Q. 275) Which of the following is not a declaration of the dictionary?`

(A) {1: ‘a’, 2: ‘b’}
(B) dict([[1,”a”],[2,”b”]])
(C) {1,”a”,2”b”}
(D) { }

## `Q. 276) ,4))`

(A) 1
(B) a
(C) 4
(D) invalid syntax for get method

## `Q. 277) ,4))`

(A) error, invalid syntax
(B) a
(C) 5
(D) 4

## `Q. 278) ,"D") print(a)`

(A) {1: ‘a’, 2: ‘b’, 3: ‘c’, 4: ‘d’}
(B) none
(C) error
(D) [1,3,6,10]

## `Q. 279) Which of the following isn’t true about dictionary keys?`

(A) more than one key isn’t allowed
(B) keys must be immutable
(C) keys must be integers
(D) when duplicate keys encountered, the last assignment wins

## `Q. 280) ) print(a)`

(A) {1: 5}
(B) {1: 5, 2: 3}
(C) error, syntax error for pop() method
(D) {1: 5, 3: 4}

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.