1.  [“john”, “peter”]

2.  [“john”:40, “peter”:45]

3.  (“john”, “peter”)

4.  (“john”:40, “peter”:45)

4
Correct Answer :

[“john”, “peter”]


Explanation :
No Explanation available for this question

1.  Since “susan” is not a value in the set, Python raises a KeyError exception

2.  It is executed fine and no exception is raised, and it returns None

3.  Since “susan” is not a key in the set, Python raises a KeyError exception

4.  Since “susan” is not a key in the set, Python raises a syntax error

4
Correct Answer :

Since “susan” is not a key in the set, Python raises a KeyError exception


Explanation :
No Explanation available for this question

1.  The values of a dictionary can be accessed using keys

2.  The keys of a dictionary can be accessed using values

3.  Dictionaries aren’t ordered

4.  Dictionaries are mutable

4
Correct Answer :

The keys of a dictionary can be accessed using values


Explanation :
No Explanation available for this question

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

2.  dict([[1,”A”],[2,”B”]])

3.  {1,”A”,2”B”}

4.  { }

4
Correct Answer :

{1,”A”,2”B”}


Explanation :
No Explanation available for this question

1.  1 A 2 B 3 C

2.  1 2 3

3.  A B C

4.  1:”A” 2:”B” 3:”C”

4
Correct Answer :

1 A 2 B 3 C


Explanation :
No Explanation available for this question

1.  1

2.  A

3.  4

4.  Invalid syntax for get method

4
Correct Answer :

A


Explanation :
No Explanation available for this question

1.  Error, invalid syntax

2.  A

3.  5

4.  4

4
Correct Answer :

4


Explanation :
No Explanation available for this question

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

2.  C

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

4.  No method called setdefault() exists for dictionary

4
Correct Answer :

C


Explanation :
No Explanation available for this question

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

2.  None

3.  Error

4.  [1,3,6,10]

4
Correct Answer :

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


Explanation :
No Explanation available for this question

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

2.  Method update() doesn’t exist for dictionaries

3.  {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}

4.  {4: ‘D’, 5: ‘E’}

4
Correct Answer :

{1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}


Explanation :
No Explanation available for this question

Interview Questions

MongoDB
Java Script
Node JS
PHP
JQuery
Python