Spread the love Test your knowledge by answering the Python Interview Questions Quiz (Intermediate Level) Python Intermediate Level Interview Questions Quiz Test your knowledge by answering the Python Interview Questions Quiz (Intermediate Level) 1 / 20 What is the output of: print([i**2 for i in range(3)])? [1, 2, 3] [0, 1, 4] [0, 1, 9] [1, 4, 9] 2 / 20 Which of these is a mutable data type in Python? Tuple String List Integer 3 / 20 What will be the result of: len('Python')? 5 6 7 Error 4 / 20 Which of these statements about Python dictionaries is true? Keys can be mutable Values must be unique Dictionaries are unordered You cannot delete keys 5 / 20 What does the 'is' keyword check in Python? Equality of two objects Identity of two objects Membership in a list Type of an object 6 / 20 What will be the output of: print('Python'.find('o'))? 4 -1 3 5 7 / 20 What is the output of: print(bool(0))? False True None 0 8 / 20 What is the correct way to open a file in write mode? open('file.txt', 'r') open('file.txt', 'w') open('file.txt', 'x') open('file.txt', 'rw') 9 / 20 Which function is used to iterate through both keys and values in a dictionary? items() keys() values() iteritems() 10 / 20 What will be the output of: print(type({}))? <class 'set'> <class 'dict'> <class 'tuple'> <class 'list'> 11 / 20 Which of these is not a valid Python data type? Dictionary Array Tuple Set 12 / 20 What does the built-in enumerate() function do? Generates random numbers Returns index and value pairs Sorts a list Iterates over a sequence 13 / 20 How is exception handling implemented in Python? if-else try-except for-while def-return 14 / 20 What is the output of: print(3 * 'Hi')? 'HiHiHi' 'HiHi' ['Hi', 'Hi', 'Hi'] Error 15 / 20 What is the output of: print(10 // 3)? 3.33 3 4 Error 16 / 20 Which module is used for handling JSON data in Python? os json sys data 17 / 20 How do you comment a single line in Python? // # /* */ ' ' 18 / 20 What does the zip() function do in Python? Compresses data Maps multiple iterables into tuples Unzips a file Combines strings 19 / 20 Which of the following is used to create an empty set in Python? {} set() [] tuple() 20 / 20 What is the output of: print('hello'.capitalize())? 'Hello' 'hello' 'HELLO' 'hELLO' Your score isThe average score is 63% 0% Restart quiz Related: Python Basics Interview Questions Quiz (Multiple Choice) Post navigation Python Basics Interview Questions Quiz (Multiple Choice)Python Advance Level Interview Questions Quiz (Multiple Choice)