› Teaching Materials › Prepare level 12

What is new in this level?

In this last level of Hedy Advanced students will learn how to use basic functions.

New in this level:

  • Using basic functions with define and call
  • Slides Present the level, one concept at a time

Common mistakes

Students make a function but forget to call it.

What students get wrong

A function only works when you call it.

define greet_costumer
    print 'Hello'
    print 'How are you doing?'
How to fix it

Call the function

define greet_costumer
    print 'Hello'
    print 'How are you doing?'

call greet_costumer

Students have trouble with indentation.

What students get wrong

Indentation will stay tricky for many students

define function
print 'Use indentation in a function.'
if use_if_statement is 'yes'
print 'And don't forget to use indentation for the loops as well'
How to fix it

Use correct indentation when using a function

define function
    print 'Use indentation in a function.'
    if use_if_statement_too is 'yes'
        print 'And don't forget to use indentation for the loops as well'

Students forget quotation marks

What students get wrong

Students need more quotation marks now than in the previous levels. In this example quotation marks were forgotten in the list and in the if command.

superheroes = Spiderman, Batman, Iron Man
superhero = superheroes at random
if superhero = Batman
    print 'IM BATMAN!'
How to fix it

This is the correct code:

superheroes = 'Spiderman', 'Batman', 'Iron Man'
superhero = superheroes at random
if superhero is 'Batman'
    print 'IM BATMAN!'