1.  Error, copy() method doesn’t exist for dictionaries

2.  {1: ‘A’, 2: ‘B’, 3: ‘C’}

3.  {1: ‘A’, 2: ‘D’, 3: ‘C’}

4.  “None” is printed

4
Correct Answer :

{1: ‘A’, 2: ‘B’, 3: ‘C’}


Explanation :
No Explanation available for this question

1.  None

2.  { None:None, None:None, None:None}

3.  {1:None, 2:None, 3:None}

4.  { }

4
Correct Answer :

{ }


Explanation :
No Explanation available for this question

1.  More than one key isn’t allowed

2.  Keys must be immutable

3.  Keys must be integers

4.  When duplicate keys encountered, the last assignment wins

4
Correct Answer :

Keys must be integers


Explanation :
No Explanation available for this question

1.  {1: 5}

2.  {1: 5, 2: 3}

3.  Error, syntax error for pop() method

4.  {1: 5, 3: 4}

4
Correct Answer :

{1: 5, 2: 3}


Explanation :
No Explanation available for this question

1.  9

2.  3

3.  Too many arguments for pop() method

4.  4

4
Correct Answer :

9


Explanation :
No Explanation available for this question

1.  1 2 3

2.  ‘A’ ‘B’ ‘C’

3.  1 ‘A’ 2 ‘B’ 3 ‘C’

4.  Error, it should be: for i in a.items():

4
Correct Answer :

1 2 3


Explanation :
No Explanation available for this question

1.  Syntax error

2.  dict_items([(‘A’), (‘B’), (‘C’)])

3.  dict_items([(1,2,3)])

4.  dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])

4
Correct Answer :

dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])


Explanation :
No Explanation available for this question

1.  More than one key can have the same value

2.  The values of the dictionary can be accessed as dict[key]

3.  Values of a dictionary must be unique

4.  Values of a dictionary can be a mixture of letters and numbers

4
Correct Answer :

Values of a dictionary must be unique


Explanation :
No Explanation available for this question

1.  method del doesn’t exist for the dictionary

2.  del deletes the values in the dictionary

3.  del deletes the entire dictionary

4.  del deletes the keys in the dictionary

4
Correct Answer :

del deletes the entire dictionary


Explanation :
No Explanation available for this question

1.  Removes an arbitrary element

2.  Removes all the key-value pairs

3.  Removes the key-value pair for the key given as an argument

4.  Invalid method for dictionary

4
Correct Answer :

Removes an arbitrary element


Explanation :
No Explanation available for this question

Interview Questions

MongoDB
Java Script
Node JS
PHP
JQuery
Python