The following code will return data as ______________
1.List
2.Tuple
3.Dictionary
4.None of the above
Posted Date:-2021-12-06 10:29:53
_______ datatype fall under mapping
1.List
2.Tuple
3.Dictionary
4.String
Posted Date:-2021-12-06 10:52:56
_______ is the suitable data type for keys of dictionary in python.
1.Number
2.String
3.Tuple
4.All the above
Posted Date:-2021-12-06 10:57:18
_________ function returns the number of key: value pairs of the dictionary.
1.total( )
2.len( )
3.length( )
4.items( )
Posted Date:-2021-12-06 11:06:20
_________ function returns the value corresponding to the key passed as the argument.
1.get( )
2.values( )
3.update( )
4.update( )
Posted Date:-2021-12-06 11:15:50
1,2,3 are the ______________ in the following dictionary. D = {1 : “One”, 2 : “Two”, 3 : “Three”}
1.Keys
2.Values
3.Items
4.None of the above
Posted Date:-2021-12-06 10:21:58
A = {“A” : “Apple”, “B” : “Ball”, “C” : “Cat”} Which of the following statement will return : dict_items([(‘A’, ‘Apple’), (‘B’, ‘Ball’), (‘C’, ‘Cat’)])
1.print(A.keys( ))
2.print(A.values( ))
3.print(A.Items( ))
4.print(A.get( ))
Posted Date:-2021-12-06 11:12:28
All elements in dictionary are separated by _________
1.Semicolon(;)
2.Comma( ,)
3.Semicolon(;)
4.dot(.)
Posted Date:-2021-12-06 10:19:32
Choose the correct statement Assertion (A) : Items in dictionaries are unordered. Reason (R) : We may not get back the data in the same order in which we had entered the data initially in the dictionary.
1.A is true but R is false
2.A is false but R is true
3.Both A and R are false
4.Both A and R are true and R is the correct explanation of A
Posted Date:-2021-12-06 10:56:21
Choose the correct statement : Statement A : Dictionaries are mutable. Statement B : Contents of the dictionary can not changed after it has been created
1.Statement A is True
2.Statement B is True
3.Both the statements are True
4.Statement A is True and Statement B is False
Posted Date:-2021-12-06 11:03:07
Dictionaries in python are _______
1.Mutable data type
2.Non-Mutable data type
3.Mapping data type
4.Both a and c
Posted Date:-2021-12-06 09:03:43
Dictionary is a ___________ data type.
1.Sequence
2.Mapping
3.Ordered
4.None of the above
Posted Date:-2021-12-06 09:06:37
Following statement return values in the form of _______ >>> D1.keys() #D1 is a dictionary
1.tuple
2.list
3.string
4.dictionary
Posted Date:-2021-12-06 11:09:53
In dictionary Keys and values are separated by ________________
1.Colon (:)
2.Comma( ,)
3.Semicolon(;)
4.dot(.)
Posted Date:-2021-12-06 10:17:34
Key – value concept is in ____
1.List
2.String
3.Dictionary
4.Tuple
Posted Date:-2021-12-06 10:15:21
Keys in dictionary are _____________ .
1.Mutable
2.Immutable
3.antique
4.integers
Posted Date:-2021-12-06 10:23:15
Keys of dictionary must be _______________
1.antique
2.unique
3.mutable
4.integers
Posted Date:-2021-12-06 06:49:55
pop( ) function delete and ____ the element of dictionary.
1.display
2.return
3.not return
4.add
Posted Date:-2021-12-06 10:46:36
The following code is an example of _______ N = {A: {'name': 'Ravi', 'age': '5', 'sex': 'M'}, B: {'name': 'Golu', 'age': '2', 'sex': 'F'}}
1.Normal Dictionary
2.Nested Dictionary
3.Empty Dictionary
4.All the above
Posted Date:-2021-12-06 10:43:51
The key-value pair in dictionary is called ____
1.item
2.pair item
3.paired value
4.value
Posted Date:-2021-12-06 10:55:18
Traversing a dictionary can be done using ____________
1. if statement
2.loop
3.jump statement
4.None of the above
Posted Date:-2021-12-06 10:28:22
What type of error is returned by the following code : a={'a' : "Apple", 'b' : "Banana" , 'c' : "Cat"} print(a[1])
1.KeyError
2.KeyNotFoundError
3.NotFoundError
4.Syntax Error
Posted Date:-2021-12-06 10:24:27
Which function helps to merge dictionary ‘D1’ and ‘D2’?
1.merge( )
2.append( )
3.update( )
4. get( )
Posted Date:-2021-12-06 11:18:04
Which of the following are immutable data type? a. String b. Tuple c. List d. Dictionary
1.a and c
2. b and d
3.a and b
4.c and d
Posted Date:-2021-12-06 11:14:34
Which of the following function create a dictionary from a sequence of key-value pairs
1.dictionary( )
2.dict( )
3.create( )
4.convert( )
Posted Date:-2021-12-06 11:08:39
Which of the following is an example of dictionary?
1.L = [ ]
2.C = ( )
3.D = { }
4.None of the above
Posted Date:-2021-12-06 10:20:26
Which of the following is feature of Dictionary?
1.Keys are unique within a dictionary.
2.Keys are unique within a dictionary.
3.Dictionary is mutable.
4.All of the above
Posted Date:-2021-12-06 11:11:05
Which of the following is feature of Dictionary?
1.Keys are unique within a dictionary.
2.Keys are unique within a dictionary.
3.Dictionary is mutable.
4.All of the above
Posted Date:-2021-12-06 11:11:19
Which of the following is feature of Dictionary?
1.Keys are unique within a dictionary.
2.Keys are unique within a dictionary.
3.Dictionary is mutable.
4.All of the above
Posted Date:-2021-12-06 11:11:22
Which of the following is feature of Dictionary?
1.Keys are unique within a dictionary.
2.Keys are unique within a dictionary.
3.Dictionary is mutable.
4.All of the above
Posted Date:-2021-12-06 11:11:26
Which of the following is feature of Dictionary?
1.Keys are unique within a dictionary.
2.Keys are unique within a dictionary.
3.Dictionary is mutable.
4.All of the above
Posted Date:-2021-12-06 11:11:32
Which of the following is not method of dictionary?
1.len( )
2.pop( )
3.del ( )
4.update( )
Posted Date:-2021-12-06 10:48:02
Which of the following is used to delete an element from Dictionary?
1.pop( )
2.delete
3.remove
4.None of the above
Posted Date:-2021-12-06 09:04:39
Which statement is not correct in reference to the following code? A = {1 : "One", 2 : "Two", 3 : "Three"} A[4] = "Four"
1.It will add value at the end of dictionary.
2.It will modify value if the key already exist.
3.It will add value in between of the dictionary.
4.All the above
Posted Date:-2021-12-06 10:40:51
Which statement is used to create an empty dictionary? a.
1.d1 = { }
2.d1 = ( )
3. d1 = dict{ }
4.d1 = [ ]
Posted Date:-2021-12-06 09:06:04
Write the output of the following : A = {"A" : "Apple", "B" : "Ball", "C" : "Cat"} print(A.get("D"))
1.KeyNotFoundError
2.Name Error
3.Type Error
4.None
Posted Date:-2021-12-06 11:17:14
Write the output of the following : A = {1 : "One", 2 : "Two", 3 : "Three"} print("One" in A)
1.True
2.False
3.Error
4.One
Posted Date:-2021-12-06 11:04:39
Write the output of the following : d1 = {"a" : 50, "b" : 50} d2 = {"a" : 500, "b" : 50} print(d1 > d2)
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-06 09:07:29
Write the output of the following code : A = {1 : "One", 2 : "Two", 3 : "Three"} B = {'A' : "Apple", 'B' : "Bat", 'C' : "Cat", 'D' : "Doll"} A.update(B) #print(B.values()) print(B)
1. {‘A’ : ‘Apple’ , ‘B’ : ‘Bat’ , ‘C’ : ‘Cat’ , ‘D’ : ‘Doll’}
2.{1 : “One” , 2 : “Two” , 3 : “Three”}
3.{1: ‘One’ , 2: ‘Two’ , 3: ‘Three’ , ‘A’: ‘Apple’ , ‘B’: ‘Bat’ , ‘C’: ‘Cat’ , ‘D’: ‘Doll’}
4.None of the above
Posted Date:-2021-12-06 10:32:08
Write the output of the following code : A = {1 : "One", 2 : "Two", 3 : "Three"} B = {'A' : "Apple", 'B' : "Bat", 'C' : "Cat", 'D' : "Doll"} print(A.get(4,"Key Not Found"))
1.KeyError
2.Key Not Found
3.None
4.Syntax Error
Posted Date:-2021-12-06 10:35:02
Write the output of the following code : A = {1 : "One", 2 : "Two", 3 : "Three"} print(A[2] + A[1])
1.Error
2.TwoOne
3.21
4.{1 : “One”, 2 : “Two”, 3 : “Three”}
Posted Date:-2021-12-06 10:50:30
Write the output of the following code : a={'a' : "Apple", 'b' : "Banana" , 'c' : "Cat"} a['a']="Anar" print(a)
1.{‘a’: ‘Anar’, ‘b’: ‘Banana’, ‘c’: ‘Cat’}
2.Error
3.{‘a’ : “Apple, ‘a’: ‘Anar’, ‘b’: ‘Banana’, ‘c’: ‘Cat’}
4.None of the above
Posted Date:-2021-12-06 10:26:07
Write the output of the following: A = {1 : "One", 2 : "Two", 3 : "Three"} B = {'A' : "Apple", 'B' : "Bat", 'C' : "Cat", 'D' : "Doll"} for i in A: print(i)
1.1 2 3
2.1 2 3
3.{1 : “One”, 2 : “Two”, 3 : “Three”}
4.None of the above
Posted Date:-2021-12-06 10:39:24