Python Revision Tour – II
(80 Marks)
1. Answer the following Questions (5×2 =
10)
1. What is a loop? Name any two types of loops in Python.
2. What does the break statement do?
3. Write a short note on range().
4. What is the output of:
for i in range(2, 10, 3):
print(i)
5. Write the syntax of a while loop.
2. Answer the following Questions (5×3 =
15)
1. Rewrite the following code using a while loop:
for i in range(5, 0, -1):
print(i)
2. Explain the difference between pass, break, and continue with examples.
3. What is the difference between else in if and else in loop?
4. Write a program to display the multiplication table of a number.
5. Write a program to print all even numbers between 1 and 50 using a loop.
3. Answer the following Questions (11×5 =
55)
1. Write a program that uses both for and while to display prime numbers between
10 and 50.
2. Create a menu-driven program that performs addition, subtraction,
multiplication, and division.
3. Write a program to reverse a string using a loop.
4. Write a program that reads numbers until 0 is entered and displays their sum
and count.
5. Write a program to print the following pattern:
*
* *
* * *
* * * *
6. Write a Python program to find factorial of a number using loop.
7. Write a program to print Fibonacci series using a loop.
8. Create a nested loop to print a number triangle.
9. Write a program to check whether a number is an Armstrong number.
10. Write a program to count the number of digits in a number using a loop.
11. Write a program to calculate the sum of digits of a number.