(MCQs) 1. What is the correct syntax to define a function in Python? a) def function_name b) function_name() c) def function_name(): d) function function_name() 2. Which of the following is true about recursion in Python? a) A recursive function calls itself. b) Recursive functions are faster than loops. c) Recursion does not require a base case. d) Recursion is used to iterate over dictionaries. 3. How do you import a module in Python? a) module.import() b) import module_name c) include module_name d) using module_name 4. What does the __init__ method do in a class? a) Initializes a class variable b) Deletes an object c) Initializes an object's attributes d) Calls a method within the class 5. Which of the following demonstrates polymorphism in Python? a) Overloading a function b) Using multiple classes c) Inheritance from a superclass d) A method that behaves differently based on the object True/False Questions 6. A function in Python can return multiple values. 7. Every recursive function must have a base case to prevent infinite recursion. 8. Tkinter is used in Python for data analysis. 9. A module in Python can contain functions, classes, and variables. 10. Polymorphism allows objects of different classes to be treated as objects of a common superclass. Explanation Questions 11. Explain the purpose of the self keyword in Python classes. Why is it important? 12. Describe how recursion works. Provide an example where recursion is more efficient than iteration. 13. Explain how to create and use a module in Python. Why are modules beneficial in large projects? 14. What is polymorphism in Python? Explain with an example of how it can be implemented. 15. Discuss the role of Tkinter in Python. How can it be used to create a simple GUI application? Practical Questions 16. Write a Python function that calculates the factorial of a number using recursion. 17. Create a simple Python class Animal with an attribute name and a method speak(). Then, create two subclasses Dog and Cat, each with a different implementation of the speak() method. 18. Write a Python script that imports a custom module named math_operations and uses it to perform addition, subtraction, and multiplication. 19. Implement a Python program that uses polymorphism to handle different types of shapes (e.g., Circle, Square) and calculates their areas. 20. Create a simple Tkinter window with a label and a button. When the button is clicked, the label text should change. (MCQs) 1. Which of the following is the correct way to call a method from an object in Python? a) object.method_name() b) method_name(object) c) object->method_name() d) method_name.object() 2. What is the base case in recursion? a) The first case in a loop b) The condition where recursion ends c) The case where recursion begins d) A function without a return statement 3. How do you define a module in Python? a) A Python script file with a .mod extension b) A class definition c) A function defined within another function d) A Python script file with a .py extension 4. Which method is automatically called when an object is created in Python? a) start() b) create() c) init() d) new() 5. What is method overriding in Python? a) Defining a method with the same name in a subclass as in its superclass b) Defining a function with the same name in different modules c) Creating multiple methods with the same name in the same class d) Defining a method outside of a class True/False Questions 6. A Python function can be defined inside another function. 7. Recursive functions always require more memory than iterative solutions. 8. Tkinter is a standard Python library for GUI development. 9. Classes in Python can only inherit from one superclass. 10. Polymorphism can only be achieved through method overriding. Explanation Questions 11. Explain the concept of a module in Python. How do you create and use one? 12. Describe the difference between a regular function and a recursive function. When should you prefer recursion over iteration? 13. What is the significance of the __init__ method in Python? Explain with an example. 14. How does polymorphism support flexibility in code? Provide an example. 15. Explain how Tkinter can be used to handle events in a GUI application. Practical Questions 16. Write a Python function that calculates the nth Fibonacci number using recursion. 17. Implement a Python class Vehicle with a method fuel_type(). Then, create subclasses Car and Bike, each with their own implementation of the fuel_type() method. 18. Create a Python module named string_operations that contains functions to reverse a string, check for palindromes, and convert a string to uppercase. Demonstrate the usage of this module. 19. Write a Python program that demonstrates polymorphism using a base class Shape and derived classes Triangle and Rectangle. Each class should have a method area() that calculates the area of the shape. 20. Create a Tkinter application with an entry widget and a button. When the button is clicked, the text entered in the entry widget should be displayed in a label.