Python Programming Exam Questions
Python Programming Exam Questions
2. Explain the difference between compiled and interpreted languages. Where does Python fit?
12. Explain the difference between mutable and immutable objects in Python.
Programming Questions:
1. Write a Python program to swap two variables without using a temporary variable.
5. Write a Python program to find the greatest of three numbers entered by the user.
if i % 3 == 0:
continue
Programming Questions:
5. Write a program to print all numbers divisible by 3 and 5 between 1 and 100.
6. Write a recursive function to calculate the sum of the first n natural numbers.
try:
x=5/0
except ZeroDivisionError:
10. What is the difference between syntax errors and runtime errors?
Programming Questions:
3. Write a program that reads a file and prints only the even-numbered lines.
for i in range(5)
print(i)
x = "Python"
print(x[::-1])
def test():
print(test())
numbers = [1, 2, 3, 4, 5]
print(numbers[5])
✅ Revise Python basics, loops, functions, file handling, and exception handling.
✅ Practice writing code instead of just reading theory.
✅ Solve previous year questions and predict output-based questions.
✅ Use online platforms like W3Schools, GeeksforGeeks, and HackerRank for extra practice.