› Teaching Materials › Prepare level 9

What is new in this level?

In this first level of Hedy Advanced students learn to use indentation. This allows them to use multiple lines in an if-statement or repeat multiple lines. The students often enjoy this level very much, because it allows them to make more intricate programs. On the other hand, some students will struggle understanding when to use indentation and how to do it.

New in this level:

  • Multiple lines after an if, elif or else by using indentation
  • Multiple lines after a repeat by using indentation
  • Slides Present the level, one concept at a time

Common mistakes

Students use the indentation wrong

What students get wrong

Indentation is a new concept in this level, and for some students it might be hard to learn. Make sure they practise some simple examples before making a whole program with it.

repeat 3 times
print 'hello'
How to fix it

This is the correct code:

repeat 3 times
    print 'hello'

Students only repeat 1 line when they wanted to repeat multiple lines

What students get wrong

For instance, in the code below the student wanted to take the drinks order of 3 people. But instead the program asked 3 times, but only wrote down one order.

repeat 3 times
    drink = ask 'What would you like to drink?'
print drink
How to fix it

In the correct code the third line starts with indentation too. This way it belongs to the repeat block and therefore it will be repeated 3 times. Showing your students these differences can help them understand why we need indentation to make our programs work.

repeat 3 times
    drink = ask 'What would you like to drink?'
    print drink

Students want to nest if statements, or put if statements inside a loop

What students get wrong

In this level students aren't allowed yet to put if statements inside other if statements or inside repeat loops. In the next level this is allowed.

birthday = ask 'Is it you birthday?'
if birthday = yes
    repeat 3 times
        print 'Hip Hip Hooray!'
How to fix it

This is the correct code for this level:

birthday = ask 'Is it you birthday?'
if birthday = yes
    print 'Hip Hip Hooray!'
    print 'Hip Hip Hooray!'
    print 'Hip Hip Hooray!'

Students make programs that take too long to run

What students get wrong

In this level it's very easy to make programs that take a lot of time to complete. If the program takes too long, it'll be stopped, this with the intention to prevent straining the student's machine.

repeat 100 times
    print 'How many times can I repeat this?'
How to fix it

Make sure the code doesn't take too long to execute

repeat 20 times
    print 'This is enough'