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) How do you remove an item from a dictionary? A) delete(key) B) pop(key) C) discard(key) D) remove(key) 2 / 30 2) What is the purpose of the @staticmethod decorator? A) To define a method that does not require access to instance or class variables B) To create private methods C) To define an instance method D) To define a method that can modify class state 3 / 30 3) How do you implement a simple state machine in Python? A) 2 B) True C) A basic implementation using classes to represent states D) 3 4 / 30 4) What is metaprogramming in Python? A) Writing code that manipulates classes and functions at runtime B) Writing functions with decorators C) Writing multi-threaded applications D) Writing recursive functions 5 / 30 5) How do you use metaclasses in Python? A) By using inheritance alone B) By using decorators C) By defining a regular class D) By defining a class that inherits from type and overriding methods like __new__() 6 / 30 6) How do you optimize recursive functions in Python to avoid maximum recursion depth errors? A) By using tail recursion or the sys.setrecursionlimit() function B) By using global variables C) By using map() and filter() D) By using functools.reduce() 7 / 30 7) How do you implement middleware in a Python web framework? A) By creating a separate process B) By using decorators C) By using static methods D) By creating a middleware class or function that intercepts requests and responses 8 / 30 8) 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 9 / 30 9) How do you implement a binary search algorithm? A) True B) 3 C) 2 D) An efficient algorithm for finding an item in a sorted list 10 / 30 10) How do you mock external dependencies during testing in Python? A) By using a subprocess B) By using the unittest.mock library to mock external services or dependencies C) By using global variables D) By skipping the test 11 / 30 11) How do you create a generator expression in Python? A) generate(x for x in range(10)) B) generator(x for x in range(10)) C) [x for x in range(10)] D) (x for x in range(10)) 12 / 30 12) How do you implement a backtracking algorithm in Python? A) By using recursion to explore all possible solutions and backtrack when necessary B) By using dynamic programming C) By using global variables D) By using loops 13 / 30 13) What is the output of print(10 // 3)? A) 3 B) 0 C) 10 D) 3.33 14 / 30 14) What does the zip() function do in Python? A) Appends two lists B) Adds elements of lists C) Zips a file D) Combines multiple lists into tuples 15 / 30 15) Which exception is raised when dividing by zero? A) IndexError B) ZeroDivisionError C) KeyError D) ValueError 16 / 30 16) What will be the output of the following code: print(1 + 2 * 3)? A) 7 B) 1 C) 9 D) None 17 / 30 17) What will be the output of the following code: print("hello".islower())? A) 1 B) FALSE C) None D) TRUE 18 / 30 18) What will be the output of the following code: print([i ** 2 for i in range(5)])? A) 3 B) [1, 4, 9, 16, 25] C) [0, 1, 4, 9, 16] D) [0, 1, 2, 3, 4] 19 / 30 19) What will be the output of the following code: print("abc".split("b"))? A) ['abc'] B) ['a', 'c'] C) None D) 1 20 / 30 20) What will be the output of the following code: print(int(5.9))? A) None B) 6 C) 5 D) 1 21 / 30 21) What will be the output of the following code: print(1 + "1")? A) TypeError B) 2 C) 1 D) None 22 / 30 22) What will be the output of the following code: print({1, 1, 2})? A) {1, 1, 2} B) {1, 2} C) None D) 1 23 / 30 23) What will be the output of the following code: print("abc".isalnum())? A) FALSE B) 1 C) None D) TRUE 24 / 30 24) What will be the output of the following code: print(type([1, 2, 3]) == list)? A) None B) FALSE C) 1 D) TRUE 25 / 30 25) What will be the output of the following code: print([x ** 2 for x in range(4)])? A) [0, 1, 4, 9] B) [1, 2, 3] C) None D) 1 26 / 30 26) What will be the output of the following code: print("abc" == "abc")? A) 1 B) None C) TRUE D) FALSE 27 / 30 27) What will be the output of the following code: print("123".isdigit())? A) FALSE B) None C) 1 D) TRUE 28 / 30 28) What will be the output of the following code: print({"a", "b", "c"} - {"b"})? A) None B) {'a', 'c'} C) {'b'} D) 1 29 / 30 29) What will be the output of the following code: print("hello".endswith("lo"))? A) FALSE B) 1 C) None D) TRUE 30 / 30 30) What will be the output of the following code: print({1, 2, 2, 3})? A) {2} B) 1 C) {1, 2, 3} D) None 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