41. Tuples can't be made keys of a dictionary.
42. What will be the output of the following Python code?
>>> a=(0,1,2,3,4)
>>> b=slice(0,2)
>>> a[b]
>>> a=(0,1,2,3,4)
>>> b=slice(0,2)
>>> a[b]
43. Is the following Python code valid?
>>> a,b,c=1,2,3
>>> a,b,c
>>> a,b,c=1,2,3
>>> a,b,c
44. What will be the output of the following Python code?
>>>t = (1, 2)
>>>2 * t
>>>t = (1, 2)
>>>2 * t
45. What will be the output of the following Python code?
>>> a,b=6,7
>>> a,b=b,a
>>> a,b
>>> a,b=6,7
>>> a,b=b,a
>>> a,b
46. If a=(1,2,3,4), a[1:-1] is . . . . . . . .
47. 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)
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)
48. What will be the output of the following Python code?
d = {"john":40, "peter":45}
d["john"]
d = {"john":40, "peter":45}
d["john"]
49. What will be the output of the following Python code?
>>> a=(2,3,4)
>>> sum(a,3)
>>> a=(2,3,4)
>>> sum(a,3)
50. What will be the output of the following Python code?
>>> a=(2,3,1,5)
>>> a.sort()
>>> a
>>> a=(2,3,1,5)
>>> a.sort()
>>> a