Python Data Type Python Data Type Please wait while the activity loads. If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled. If loading fails, click here to try again Question 1Which of these is not a core data type?ListsDictionaryTuplesClassPython Data Type Discuss itQuestion 1-Explanation: Class is a user defined data typeQuestion 2What data type is the object below ? L = [1, 23, ‘hello’, 1]ListDictionaryTupleArrayPython Data Type Discuss itQuestion 2-Explanation: [ ] defines a listQuestion 3Which of the following function convert a string to a float in python?int(x [,base])long(x [,base] )float(x)str(x)Python Data Type Discuss itQuestion 3-Explanation: float(x) − Converts x to a floating-point numberQuestion 4 Which of the following statement(s) is TRUE? A hash function takes a message of arbitrary length and generates a fixed length code.A hash function takes a message of fixed length and generates a code of variable length.A hash function may give the same hash value for distinct messages. I only II and III only I and III only II only GATE IT 2006 Python Data Type Top MCQs on Hash Data Strcuture with Answers Discuss itQuestion 4-Explanation: Hash function is defined as any function that can be used to map data of arbitrary size of data to a fixed size data.. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes : Statement 1 is correct Yes, it is possible that a Hash Function maps a value to a same location in the memory that\'s why collision occurs and we have different technique to handle this problem : Statement 3 is correct. eg : we have hash function, h(x) = x mod 3 Acc to Statement 1, no matter what the value of \'x\' is h(x) results in a fixed mapping location. Acc. to Statement 3, h(x) can result in same mapping mapping location for different value of \'x\' e.g. if x = 4 or x = 7 , h(x) = 1 in both the cases, although collision occurs. Question 5Question 1: Find the output of the following program: nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv'] pos = nameList.index("GeeksforGeeks") print (pos * 3) GeeksforGeeks GeeksforGeeks GeeksforGeeksHarshHarsh Harsh HarshValueError: \'GeeksforGeeks\' is not in listPython Data Type Python Data Type Discuss itQuestion 5-Explanation: The task of the index is to find the position of a supplied value in a given list. In the above program the supplied value is “GeeksforGeeks” and the list is nameList. As GeeksforGeeks is not present in the list, an exception is thrown.Question 6Question 1: Find the output of the following program: nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv'] pos = nameList.index("GeeksforGeeks") print (pos * 3) GeeksforGeeks GeeksforGeeks GeeksforGeeksHarshHarsh Harsh HarshValueError: \'GeeksforGeeks\' is not in listPython Data Type Python Data Type Discuss itQuestion 6-Explanation: The task of the index is to find the position of a supplied value in a given list. In the above program the supplied value is “GeeksforGeeks” and the list is nameList. As GeeksforGeeks is not present in the list, an exception is thrown.Question 7Question 1:Find the output of the following program: D = dict() for x in enumerate(range(2)): D[x[0]] = x[1] D[x[1]+7] = x[0] print(D) {0: 1, 7: 0, 1: 1, 8: 0}{1: 1, 7: 2, 0: 1, 8: 1}{0: 0, 7: 0, 1: 1, 8: 1}KeyErrorPython Dictionary Quiz Python Data Type Discuss itQuestion 7-Explanation: enumerate() will return a tuple, the loop will have x = (0, 0), (1, 1). Thus D[0] = 0, D[1] = 1, D[0 + 7] = D[7] = 0 and D[1 + 7] = D[8] = 1. Note: Dictionary is unordered, so the sequence of the key-value pair may differ in each output.Question 8Question 6:Find the output of the following program: a = {i: i * i for i in range(6)} print (a) Dictionary comprehension doesn’t exist{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6:36} {0: 0, 1: 1, 4: 4, 9: 9, 16: 16, 25: 25}{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}Python Dictionary Quiz Python Data Type Discuss itQuestion 8-Explanation: The above piece of code written in curly braces generate the whole Dictionary. 1 There are 8 questions to complete. You have completed questions question Your accuracy is Correct Wrong Partial-Credit You have not finished your quiz. If you leave this page, your progress will be lost. Correct Answer You Selected Not Attempted Final Score on Quiz Attempted Questions Correct Attempted Questions Wrong Questions Not Attempted Total Questions on Quiz Question Details Results Date Score Hint Time allowed minutes seconds Time used Answer Choice(s) Selected Question Text Need more practice! Keep trying! Not bad! Good work! Perfect! Last Updated : 26 Oct, 2020 Share your thoughts in the comments Add Your Comment Please Login to comment...