Module 1 · Practice
Practice questions
Three difficulty levels.
Section A — Easy
Define each:
Match each flow-chart shape to its meaning: rectangle, diamond, parallelogram, rounded rectangle.
Write the Python keyword used to define a subroutine.
What does this Python loop do?
for i in range(3):
t.forward(50)
t.left(120)
Section B — Medium
Decompose the task "make a cup of tea" into at least 5 ordered steps.
Rewrite the following code more efficiently using a loop:
t.forward(100) t.right(72) t.forward(100) t.right(72) t.forward(100) t.right(72) t.forward(100) t.right(72) t.forward(100) t.right(72)
Write a Python subroutine called draw_triangle that takes a parameter size and draws an equilateral triangle.
Write pseudocode for a program that asks the user for a number and outputs whether it is positive, negative or zero.
Section C — Hard
Using your draw_square(size) subroutine, write code that draws four squares in a row, each 50 pixels apart.
Write a Python subroutine draw_polygon(sides, size) that draws any regular polygon. Test it with a hexagon.
Draw a flow chart for a program that asks for a password. If correct, output "Welcome", otherwise let the user try again (loop until correct).