Computer Science
Which is the correct form of declaration of dictionary ?
- Day = {1:'Monday', 2:'Tuesday', 3:'wednesday'}
- Day = {1;'Monday', 2;'Tuesday', 3;'wednesday'}
- Day = [1:'Monday', 2:'Tuesday', 3:'wednesday']
- Day = {1'monday', 2'tuesday', 3'wednesday'}
Related Questions
What is the output of this code ?
>>> int("3" + "4")
- "7"
- "34"
- 34
- 24
Which line of code will cause an error ?
1. num= [5, 4, 3, [2], 1] 2. print(num[0]) 3. print(num[3][0]) 4. print(num[5])
- Line 3
- Line 2
- Line 4
- Line 1
Identify the valid declaration of L:
L = ['Mon', '23', 'hello', '60.5']
- dictionary
- string
- tuple
- list
Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is incorrect ?
- print(T[1])
- T[2] = -29
- print(max(T))
- print(len(T))