0% found this document useful (0 votes)
104 views

Python Workbook

The document provides 11 examples of Python programs for students to write as part of a Python revision. The programs cover basics like inputting and outputting names and numbers, calculations like converting weights, volumes, and areas, and conditional logic like checking passwords. The goal is to help students practice basic Python concepts like variables, input/output, calculations, and conditional statements.

Uploaded by

Reem Abuzeid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Python Workbook

The document provides 11 examples of Python programs for students to write as part of a Python revision. The programs cover basics like inputting and outputting names and numbers, calculations like converting weights, volumes, and areas, and conditional logic like checking passwords. The goal is to help students practice basic Python concepts like variables, input/output, calculations, and conditional statements.

Uploaded by

Reem Abuzeid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Python Revision

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, which does the following:


• Asks for your current level in 3 subjects
• Stores the inputs in different, suitably named variables
• Displays your current levels in an organised, well presented report on the screen
Example 4

• 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

• Weights can be converted from pounds to kilograms using the following


formula
(note that “kilo” is simply a variable):
• kilo = pound * 0.45

• Write a program to input a weight in pounds and output the equivalent


weight in kilograms.
Example 7

• Enter the length, width and depth of a rectangular swimming pool.

• 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

• Write a program to work out the areas of a rectangle.


• Ask the user for the width and height and store them.
• Calculate the area and show the results.

• 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

 Learn how to display statements using the Python GUI

 Learn how to store different variables.

 Design and create program

 Debug programs that accomplish specific goals

3  Solve problems by decomposing them into smaller parts


   Use selection in programs

 Work with variables

 Use logical reasoning to explain how some simple algorithms work

 Use logical reasoning to detect and correct errors in algorithms

4  Use procedures and functions with parameters in your programs.

 Use computational abstractions

 Model state of real world problems

 Use a programming language to solve computational problems

 Use procedures and functions with parameters in your programs.

You might also like