The City School
DHA CAMPUS
Name and Section ……………………………………………………………………
Class 7 Python Basic Review Test
Total Marks: 15
Section A: True/False (5 Marks)
(1 Mark each)
Write T for true and F for false.
1. Python uses braces {} to define blocks of code.
2. A flowchart is a graphical representation of an algorithm.
3. The print() function is used to take input from the user.
4. Python supports multiple data types, including int, float, and str.
5. Tkinter is a module used for creating graphical user interfaces in Python.
Section B: Fill in the Blanks (5 Marks)
(1 Mark each)
6. ________ is a high-level, open-source programming language used for web
development and automation.
7. A ________ is a reusable block of code that helps in breaking a program into smaller
parts.
8. The ________ operator is used for exponentiation in Python.
9. The if-else statement is an example of a ________ statement.
10. The ________ function is used to display output in Python.
Section C: Scenario-Based Questions (5 Marks)
(1 Mark each)
11. Ali wants to store the name of his favourite fruit in a variable. How should he do it
in Python?
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
12. Aisha wrote a program, but it keeps giving an indentation error. What might be the
issue?
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
13. Ahmed wants to repeat a statement 10 times in Python. Which loop should he use?
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
14. Sara needs to check if a number is positive or negative. Which Python statement
should she use?
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
15. You want to write a comment in Python explaining your code. How will you do
that?
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………