0% found this document useful (0 votes)
19 views4 pages

MOCK TEST 101 - Python by AI

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
19 views4 pages

MOCK TEST 101 - Python by AI

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

MOCK TEST 101 - Python by AI

Section 1: Theory Questions (2-5 Marks Each)

1. Type Conversion in Python


Explain type conversion in Python.
What is type casting? Provide an example.
2. Loops in Python
Define and explain different types of loops in Python.
Provide examples for each loop type.
3. Indentation and Loops
What is indentation in Python? Why is it important?
Differentiate between for loop and while loop. Provide examples.
4. Conditional Statements in Python
Define conditional statements in Python with syntax and an example.
5. Operators in Python
Explain the difference between the == operator and the is operator.
What is a ternary operator in Python?
Is Python function pass-by-reference or pass-by-value?
6. Variable Scope
Differentiate between global and local variables in Python.
Write a program to find the LCM of two numbers.
7. Functions in Python
Define a function in Python. How do you call a function in Python?
Provide an example.
Explain how to pass strings and lists as parameters to a function.
8. Mathematical Functions in Python
Discuss different types of math functions in Python with examples.
9. Recursion and Iteration
Define recursion. How is recursion different from iteration? Explain with
examples.
10. Boolean Expressions
Define Boolean expressions and Boolean operators in Python. Explain
with examples.
Section 2: Programming Problems (5-10 Marks Each)

11. Simple Calculator Program


Write a Python program to create a simple calculator.
12. Find LCM
Write a program to find the Least Common Multiple (LCM) of two
numbers.
13. Palindrome Check
Write a program to check whether a given string is a palindrome.
14. Factorial Calculation
Write a program to calculate the factorial of a number using recursion.
15. Find Maximum of Three Numbers
Write a Python program to find the maximum of three numbers.
16. Append Elements to a List
Write a program to append elements in a list.
17. Count Occurrences in a List
Write a program to count the occurrences of a word in a given
sentence.
18. String Operations
Write a Python program to demonstrate the usage of the find() and
index() functions in strings.
19. Slicing and List Operations
Write a Python program to perform slicing on a list. Also, demonstrate
list operations like pop() , insert() , and extend() .
20. Recursion for Fibonacci
Write a program using recursion to calculate the Fibonacci series up to
n terms.

Section 3: Advanced Concepts (5-10 Marks Each)

21. Object-Oriented Programming


Write about the key features of Object-Oriented Programming in
Python.
What is inheritance? Explain with an example between a parent and
child class.
22. Method Overloading and Overriding
Explain the difference between method overloading and method
overriding in Python with examples.
23. Class Methods and Static Methods
Define class methods and static methods. What is the difference
between them? Provide an example.
24. Garbage Collection
What is garbage collection in Python? How does it work? Give an
example.
25. Exception Handling
Define an exception in Python. How do you handle exceptions using
try , except , and finally blocks? Provide an example.
26. Recursion Example: Sum of List
Write a Python program using recursion to calculate the sum of a list of
numbers.
27. Access Specifiers in Python
Define access specifiers in Python. Explain public, protected, and
private members with examples.
28. Data Abstraction and Data Hiding
Define data abstraction and data hiding in Python. Discuss their
advantages.
29. Super() Function
What is the use of super() in Python? Explain with an example.
30. Module and Package in Python
Explain the difference between a module and a package in Python.

Section 4: Conceptual Questions (3-5 Marks Each)

31. Slicing and Indexing


Explain how slicing and indexing work in Python with examples.
32. Mutable vs Immutable Datatypes
Differentiate between mutable and immutable datatypes in Python.
Provide examples.
33. List Operations
How do you convert a list to a tuple and vice versa? Write a program to
check if a string is a palindrome using list operations.
34. Boolean Keywords
Define Boolean keywords, Boolean numbers, and Boolean operators in
Python with examples.
35. Logical Operators
How many types of logical operators are there in Python? Explain each
of them with examples.
36. Tuple vs List
Explain the difference between a tuple and a list in Python.
37. Positional and Keyword Arguments
What are positional and keyword arguments in Python? Provide
examples.
38. Function Arguments
How do function arguments work in Python? Explain with a suitable
example.

Bonus Question:

39. List Operations


Write a Python program to swap any two elements in a list.

You might also like