Session 6

  • To explore using Python outside Rapid Router

In this session, you can explore Python outside Rapid Router. Using investigative tasks encourages learning. Pupils will understand more deeply and remember better if they have found out something for themselves.

Participants can use installed IDLE or an online Python interpreter such as the Raspberry Pi code editor to complete this lesson.

Introduction (5 mins)

  • Slide 1: Show the Python download link and then go to the Raspberry Pi code editor. Share this link with participants.

Exploring Python (20 mins)

  • Slide 2: Show the slide and ask participants to try this in the Raspberry Pi code editor. Common errors: missing brackets, missing quotes

  • Slides 3 -5 explore mathematical operators in Python.

OperatorDescription

+

Add

*

Multiply

-

Subtract

**

Raise the first number to the power of the second number, e.g. 8 ** 2 gives the square of 8

%

Modulus: this operator gives the remainder of a division, e.g. 19 % 3 gives 1 because 19 divided by 3 is 6 remainder 1.

/

Divide, e.g. 11 / 2 gives 5.5

//

Integer divide, e.g. 11 // 2 gives 5. NB this does not round, it discards any decimal.

  • Slide 6: We use variables to store values in Python programs. Try some examples

Exercises (5 mins)

  • Use the simple exercises on slide 7 for participants to practice the commands just covered

Explore Python (30 mins)

Last updated