# What will be the output of the following Python code numberGames = {} numberGames[(1,2,4)] = 8 numberGames[(4,2,1)] = 10 numberGames[(1,2)] = 12 sum = 0 for k in numberGames: sum += numberGames[k] print len(numberGames) + sum

1.  30

2.  24

3.  33

4.  12

4

33

Explanation :
No Explanation available for this question

# What is the data type of (1)

1.  Tuple

2.  Integer

3.  List

4.  Both tuple and integer

4

Integer

Explanation :
No Explanation available for this question

# If a=(1,2,3,4), a[1:-1] is _________

1.  Error, tuple slicing doesn’t exist

2.  [2,3]

3.  (2,3,4)

4.  (2,3)

4

(2,3)

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a=(1,2,(4,5)) >>> b=(1,2,(3,4)) >>> a

1.  False

2.  True

3.  Error, < operator is not valid for tuples

4.  Error, < operator is valid for tuples but not if there are sub-tuples

4

False

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a=("Check")*3 >>> a

1.  (‘Check’,’Check’,’Check’)

2.  * Operator not valid for tuples

3.  (‘CheckCheckCheck’)

4.  Syntax error

4

(‘CheckCheckCheck’)

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a=(1,2,3,4) >>> del(a)

1.  Now, a=(1,2,4)

2.  Now, a=(1,3,4)

3.  Now a=(3,4)

4.  Error as tuple is immutable

4

Error as tuple is immutable

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a=(2,3,4) >>> sum(a,3)

1.  Too many arguments for sum() method

2.  The method sum() doesn’t exist for tuples

3.  12

4.  9

4

12

Explanation :
No Explanation available for this question

# Is the following Python code valid >>> a=(1,2,3,4) >>> del a

1.  No because tuple is immutable

2.  Yes, first element in the tuple is deleted

3.  Yes, the entire tuple is deleted

4.  No, invalid syntax for del method

4

Yes, the entire tuple is deleted

Explanation :
No Explanation available for this question

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

1.  Array of tuples

2.  List of tuples

3.  Tuples of lists

4.  Invalid type

4

List of tuples

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a=(0,1,2,3,4) >>> b=slice(0,2) >>> a[b]

1.  Invalid syntax for slicing

2.  [0,2]

3.  (0,1)

4.  (0,2)

4