Digital Literacy Key Stage 3 - Python


IF ELSE

In this lesson you will learn how to use IF ELSE statements in Python.

Starter

if 10==10:

print "hello"

Main

Create programs for the following tasks.

Now we want the program to feedback and different answer depending on the size of a number. See if you can create the program to ask the users to Input a number and then if the number is bigger than 500 state big number ELSE print small number.

Your teacher will now show you the answer.

If you get time

What about three responses the number of calories that are entered. For example, less than 250, less than 500, more than 500? You can use the ELIF function, this means else if.

 Assessment

  • I can create IF ELSE statements in Python.