admin Oct, Tue, 2024 EXAM PYTHON EXAMS 123456789101112131415161718192021222324252627282930 Exam Instructions: Total Number of Questions: 30 You will be required to answer a total of 30 multiple-choice questions. Time Limit: 15 minutes for the entire exam Once the time is up, the exam will automatically submit. Passing Criteria: A minimum score of 50% is required to pass the exam Multiple Attempts: You are allowed to take the exam multiple times. Only your highest score will be considered for certification. Additional Instructions: The exam timer cannot be paused once it begins. Good luck, and feel free to retake the exam to improve your score! Python Exam Test your Python skills with a challenging exam designed to evaluate your knowledge in programming, data structures, and algorithms The certificate will be generated based on the information you provide in the form, so please ensure that all details are entered correctly. NameEmailPhone NumberUniversityCollegeDegreeDepartmentPass Out YearPass Out Year2014201520162017201820192020202120222023202420252026202720282029 1 / 30 1) What is the difference between __getattr__() and __getattribute__() in Python? A) Both are used for attribute access B) There is no difference C) __getattr__() is for instance variables, __getattribute__() for class variables D) __getattr__() is called when an attribute is not found, while __getattribute__() is called for every attribute access 2 / 30 2) How does the yield keyword work in Python? A) Returns a value and terminates the function B) Calls the function again C) Logs information D) Returns a value and suspends the function execution 3 / 30 3) How do you perform unit testing in Python? A) By running scripts directly B) By using the unittest module to create and run tests C) By using global variables D) By using print statements 4 / 30 4) What is the __slots__ mechanism in Python? A) A type of decorator B) A way to prevent the creation of instance dictionaries and save memory by defining a fixed set of attributes C) A method for defining class methods D) A way to override attributes 5 / 30 5) What does the abc module provide in Python? A) A collection of abstract data types B) A framework for creating metaclasses C) A framework for defining abstract base classes (ABCs) D) A set of built-in methods 6 / 30 6) How do you implement a binary search algorithm recursively? A) By using a hash map B) By dividing the search interval in half and recursively searching the subarray C) By using a linear scan D) By using a while loop only 7 / 30 7) What is duck typing in Python? A) Type checking based on class B) Strict type checking C) Type checking based on behavior, not the actual class D) Compile-time type checking 8 / 30 8) How do you merge two dictionaries in Python (version 3.9 or later)? A) dict1.update(dict2) B) dict2` C) `dict1 D) dict1 + dict2 9 / 30 9) How do you handle exceptions in coroutines in Python? A) By using finally clause B) By using async for C) By using try-except blocks with await or async functions D) By using contextvars 10 / 30 10) What is the correct way to install a package using pip? A) pip get package_name B) install package_name C) pip install package_name D) download package_name 11 / 30 11) What is the difference between deepcopy and copy in Python? A) deepcopy() creates a copy of nested objects B) copy() copies the entire object C) deepcopy() copies the memory address D) There is no difference 12 / 30 12) What are Python type hints, and how do they help in development? A) They provide optional type annotations for better code clarity and static type checking B) They enforce type checking at runtime C) They are mandatory for all functions D) They optimize performance 13 / 30 13) How do you handle infinite recursion in Python? A) By using the finally clause B) By catching RecursionError exception or setting recursion limits via sys.setrecursionlimit() C) By using try-except block D) Python does not support recursion limits 14 / 30 14) What is the difference between isinstance() and type()? A) They are identical B) isinstance() cannot check built-in types C) isinstance() checks for subclass relationships, while type() checks for exact types D) type() is faster 15 / 30 15) What is the purpose of the weakref module in Python? A) Prevents garbage collection B) Creates weak references to objects, preventing strong reference cycles C) Handles memory leaks D) Locks memory references 16 / 30 16) What will be the output of the following code: print("123".replace("2", "5"))? A) 153 B) 125 C) None D) 1 17 / 30 17) What will be the output of the following code: print("abc".title())? A) 1 B) Abc C) abc D) None 18 / 30 18) What will be the output of the following code: print("hello".replace("l", "p"))? A) 1 B) heppo C) hello D) None 19 / 30 19) What will be the output of the following code: print("123"[0])? A) 1 B) None C) 2 D) 1 20 / 30 20) What will be the output of the following code: print("hello".replace("l", "r"))? A) 1 B) None C) herro D) hello 21 / 30 21) What will be the output of the following code: print(1 + 2 * 3)? A) 7 B) 6 C) 1 D) 9 22 / 30 22) What will be the output of the following code: print((3, 1) < (3, 2))? A) None B) FALSE C) 1 D) TRUE 23 / 30 23) What will be the output of the following code: print(3 + 5 * 2)? A) 13 B) 1 C) 8 D) 10 24 / 30 24) What will be the output of the following code: print("abc".count("b"))? A) 1 B) 1 C) None 25 / 30 25) What will be the output of the following code: print("hello".swapcase())? A) None B) HELLO C) hello D) 1 26 / 30 26) What will be the output of the following code: print(3 != 2)? A) 1 B) TRUE C) FALSE D) None 27 / 30 27) What will be the output of the following code: print("abc".count("a"))? A) 1 B) None C) 1 28 / 30 28) What will be the output of the following code: print("a" * 0)? A) None B) a C) 1 D) `` 29 / 30 29) What will be the output of the following code: print("test".startswith("te"))? A) 1 B) TRUE C) None D) FALSE 30 / 30 30) What will be the output of the following code: print((1, 2) + (3,))? A) None B) (1, 2) C) (1, 2, 3) D) 1 Your score is LinkedIn Facebook Twitter VKontakte 0% ExamWEB DEVELOPMENT EXAM...Read MoreREACT JS PROGRAMMING EXAM...Read MorePYTHON FULL STACK...Read MorePYTHON EXAMS ...Read MoreMYSQL...Read MoreMACHINE LEARNING...Read MoreJAVASCRIPT PROGRAMMING EXAM...Read MoreJAVA SPRING BOOT...Read MoreJAVA PROGRAMMING EXAM...Read MoreJAVA FULL STACK...Read MoreHTML PROGRAMMING EXAM...Read MoreDEEP LEARNING...Read MoreDATA SCIENCE...Read MoreCSS PROGRAMMING EXAM...Read MoreANGULAR JS PROGRAMMING EXAM...Read More 16Share on WhatsApp10Share on LinkedIn5Share on YouTube9Share on Facebook Comments 0