Grade 7 Python Worksheet
Section A: Print & Input
1. Write a program to print your name.
2. Write a program to input your age and print it.
3. Write a program to add two numbers entered by the user.
4. Write a program to calculate the area of a rectangle.
Section B: For Loop
5. Write a program to print numbers from 1 to 10 using a for loop.
6. Write a program to print the table of a number entered by the user.
7. Write a program to print the sum of first 10 natural numbers.
8. Write a program to print stars in this pattern: * ** *** ****
Section C: While Loop
9. Write a program to print numbers from 1 to 20 using a while loop.
10. Write a program that keeps asking your name until you type 'exit'.
11. Write a program to print the reverse of a number (e.g. 123 → 321).
12. Write a program to keep adding numbers until the user enters 0.
Section D: Mixed Practice
13. Write a program to check whether a number is even or odd.
14. Write a program to input marks of 5 subjects and find the average.
15. Write a program to make a simple calculator (Add, Subtract, Multiply, Divide).