Teaching Materials
What is new in this level?
This level focusses on functions. In Hedy advanced the students have learned how to use a basic function. In this level they'll not only learn the Python syntax of using a fucntion, but they will also learn how to use arguments in functions and return {value}.
New in this level:
- Using a function the Python way
- Using arguments in a function
- Using return {value}
- Slides Present the level, one concept at a time
Common mistakes
Students have trouble with the correct syntax and indentation of a function
What students get wrong
Students have trouble with the correct syntax and indentation of a function
def greet_the_costumer(name
print('Hello ', name, '!')
customer = 'Hedy
greet_the_costumer()customer
How to fix it
Take a careful look at the syntax and indentation.
def greet_the_costumer(name):
print('Hello ', name, '!')
customer = 'Hedy'
greet_the_costumer(customer)
Students forget to use return in the function
What students get wrong
Students forget to use return in the function
def get_a_room(number):
room_number = 1000 + number
favorite_number = 7
room_number = return get_a_room(favorite_number)
print('Your room number is ', room_number)
How to fix it
This is the correct code:
def get_a_room(number):
room_number = 1000 + number
return room_number
favorite_number = 7
room_number = get_a_room(favorite_number)
print('Your room number is ', room_number)