Digital Literacy Key Stage 3 - Python


Text and Numbers

Today you will learn how to write a programs that includes both text and numbers.

Starter

Complete the sections on page 5 on this booklet that your teacher shows you.

Main

Type:

print "2 squared is", (2 * 2)print "2 cubed is", (2 * 2 * 2)


Creating random numbers

The code to create random numbers is below. Use this to create random numbers between 1 and 10.

Save the program as Random.

 Assessment

  • I understand the code for squared and cubed.
  • I have written a program to create random numbers.