Python Workbook
Python Workbook
Year 9
Example 1
• Write a program that will allow the user to input their name and age and
then output the name and age that have been entered on the screen.
Example 2
• Write a program that will allow the user to input their name and then output
the name joined with a greeting in the format: “Hello”.
Example 3
• Write a program that will store two numbers from the use and subtract
one from the other, then display the result
Example 5
• Write a program that will input three numbers and multiply them
together, then display the result.
Example 6
• Write a program to calculate the volume of water required to fill the pool
and output the volume.
Example 8
• Write a program that will allow the user to input a value and output whether
the value is zero or above
Example 9
• Write a program that asks the user to enter a number from 1-10 to represent
how they are feeling (1=Sad, 10=Happy). Get the program to output the
message “I’m so sorry to hear you are not a happy ” if they type in a number
from 1-5. Get the program to output the message “Good to hear you are
feeling happy” if the enter a number greater than 5.
Example 10
• Extension
• Work out and display the volume!
Example 11
• Write a program that asks the user for a password. The program should
display a suitable error message if the password is incorrect and a welcome
message if the password is correct. The correct password can be stored in a
variable at the start of the program
CURRICULUM I MUST SHOW THAT I
LEVEL
1 Write simple programs using a high level programming language
2 Learn about data types