Python QuestionsBy Kritika Papne / March 20, 2023 0 votes, 0 avg 672 123456789101112131415 Python Questions 1 / 15 1. Which of the following functions can help us to find the version of python that we are currently working on? A. sys.version(1) B. sys.version(0) C. sys.version() D. sys.version 2 / 15 2. Which of the following Boolean expressions is not logically equivalent to the other three? A. not(-6<0 or-6>10) B. -6>=0 and -6<=10 C. not(-6<10 or-6==10) D. not(-6>10 or-6==10) 3 / 15 3. Which keyword is used for function in Python language? A. Function B. def C. Fun D. Define 4 / 15 4. What will be the output of the following Python code? x = 'abcd' print(list(map(list, x))) A. [‘a’, ‘b’, ‘c’, ‘d’] B. [[‘a’], [‘b’], [‘c’], [‘d’]] C. [‘abcd’] D. none of the above 5 / 15 5. What is Instantiation in terms of OOP terminology? A. Deleting an instance of class B. Modifying an instance of class C. Copying an instance of class D. Creating an instance of class 6 / 15 6. Conditional statements are also known as ___ statements. A. Decision-making B. Array C. List D. None of the mentioned above 7 / 15 7. Is Python code compiled or interpreted? A. Python code is both compiled and interpreted B. Python code is neither compiled nor interpreted C. Python code is only compiled D. Python code is only interpreted 8 / 15 8. What will be the output of the following Python code? print('abcdef'.partition('cd')) A. (‘ab’, ‘ef’) B. (‘abef’) C. (‘ab’, ‘cd’, ‘ef’) D. 2 9 / 15 9. Which of the following best describes inheritance? A. Ability of a class to derive members of another class as a part of its own definition B. Means of bundling instance variables and methods in order to restrict access to certain class members C. Focuses on variables and passing of variables to functions D. Allows for implementation of elegant software that is well designed and easily modified 10 / 15 10. Which of the following blocks will always be executed whether an exception is encountered or not in a program? A. try B. except C. finally D. none of the above 11 / 15 11. In Python, the break and continue statements, together are called ___ statement. A. Jump B. goto C. compound D. None of the mentioned above 12 / 15 12. What will be the output of the following Python code? l=list('HELLO') p=l[0], l[-1], l[1:3] 'a={0}, b={1}, c={2}'.format(*p) A. Error B. “a=’H’, b=’O’, c=(E, L)” C. “a=H, b=O, c=[‘E’, ‘L’]” D. Junk value 13 / 15 13. What will be the output of the following code snippet? numbers = (4, 7, 19, 2, 89, 45, 72, 22) sorted_numbers = sorted(numbers) even = lambda a: a % 2 == 0 even_numbers = filter(even, sorted_numbers) print(type(even_numbers)) A. int B. list C. filter D. tuple 14 / 15 14. Which of these is the definition for packages in Python? A. A set of main modules B. A folder of python modules C. A number of files containing Python definitions and statements D. A set of programs making use of Python modules 15 / 15 15. What is called when a function is defined inside a class? A. Module B. Class C. Another Function D. Method Your score isThe average score is 40% LinkedIn Facebook VKontakte 0% Restart quiz By WordPress Quiz plugin Written by Shubhranshu Shekhar, who has trained 20000+ students in coding. Kritika Papne