Hedy documentation

Common mistakes

You can learn from your mistakes, especially in coding! Making mistakes is unavoidable, and a great opportunity to learn, but for teachers, it can be a challenge to find the correct fix for a mistake! Especially as the programs get longer and longer as the students progress through the levels. That's why we've made a list with frequently made mistakes in each level, and their solutions.

Level 1

Students forget to type commands

For example they type a sentence without using print.

Hedy can't print this

Teach your students to always start a line of code with a command.

print Hedy can print this!

Students use capitals when typing commands

Commands won't work if they are in capitals.

Ask Why does my code fail?
Print Because I'm using capitals.

Remove the capitals.

ask Why does my code work now?
print Because I removed the capitals!

Students use echo without ask

Echo is made to repeat an answer after an ask command. Without ask echo won't do anything.

echo Your name is

Add an ask command to make it work.

ask What's your name?
echo Your name is

Students want their echo word (variable) to be in the middle of a sentence

And they are right! That's why they will learn to use proper variables in the next level.

ask Which programming language is the most fun?
echo is the best!

In level 1 we have to keep it at this:

ask Which programming language is the most fun?
echo The best is...

Turtle: Students let the turtle walk off of the screen

Often students love to try out big numbers when using the turtle, which causes the arrow to walk off the screen.

forward 300
turn 90

In the example, students tend to think that the turn command failed; even though it did what it what supossed to. What happened is the turtle walked past the screen limits. Use smaller numbers to prevent this from happening.

forward 100
turn 90

Turtle: Students use the command backward, but there's no such command.

Backward is not a command.

backward 100

To make the turtle go backwards, you use the forward command and a negative number. For example:

forward -100

Level 2

Students make typos in their commands

Hedy can't recognize a command with a typo.

prinnt Don't make typos

Teach your students to read the error messages. This way they can find out themselves what went wrong.

print Don't make typos

Students forget that the ask command has changed

In this level students learn about variables. The ask command requires a variable as well, but students forget this.

ask what would you like to eat

In this level you have to tell Hedy where to save your answer, so it can be used later on. This is called a variable.

order is ask What would you like to eat

Students try to use the echo command

For some students it might be frustrating to learn that the echo command doesn't work anymore. That's why it's very important to explain the advantages of using variables. For example you can use multiple variables in a code, and you can put them anywhere you like in a sentence!

answer is ask Why doesn't echo work anymore?!
echo

Use a variable instead.

answer is ask Why doens't echo work anymore?!
print answer

Students use a variable name or as a normal word

In the example below the word 'name' is used as a variable, but also as a normal text. The output of this code will be 'Hi my Hedy is Hedy'.

name is Hedy
print Hi my name is name

So don't use a word you want to use in the text as a variable name. In level 4 this is solved with quotation marks.

name is Hedy
print Hi I'm name

Students use long variable names containing two words.

A variable should be named with one word. You could use an underscore to connect two words. That counts as one.

chosen door is ask Which door do you pick

Add an underscore.

chosen_door is ask which door do you pick

Students might use two different names for the same variable

In this example the student has used 'horse' and 'name' for the same variables.

horse is ask What is your horse called
print Your horse is called name

Always check whether the variable has the same name throughout the code. Slight differences can be hard to spot (for example plurals) but they will interfere with the code.

name is ask What is your horse called
print Your horse is called name

Level 3

Students try to print whole lists

A list can't be printed. You can only print one item from the list with at random.

groceries is apples, milk, chocolate
print groceries

To print a list of all the groceries, you simply need to put them after a print command. Else you can use the list to print one item with at random.

print apples, milk, chocolate

# or

groceries is apples, milk, chocolate
print groceries at random

Students use the name of a variable or list as regular text

This problem probably occured in level 2 as well. Now it can happen with lists too.

name is Hedy
print Hi my name is name

# or

animal is rhino, bee, swan
print The best animal is... animal at random

Don't use the names of variables or lists in regular text to print. In level 4 this problem is solved with quotation marks.

name is Hedy
print Hi I'm name

# or

animals is rhino, bee, swan
print The best animal is... animals at random

Students forget at in at random

Like in the example

birds is sparrow, seagull, robin
print birds random

This problem is solved by adding the word at.

birds is sparrow, seagull, robin
print birds at random

Students forget to use the print command when also using the at random command

Or they will sometimes put at random at the beginning of the line.

fruit is apple, cherry, banana
fruit at random

Emphasize to your students that you always need a print to print text.

fruit is apple, cherry, banana
print fruit at random

Students forget to use commas in their lists

In a list items are seperated with a comma.

pizzas is funghi tonno quattro stagioni
print pizzas at random

After each item on your list, there should be a comma

pizzas is funghi, tonno, quattro stagioni
print pizzas at random

Students try to use at random without a list

For example

clubs is Manchester United
print clubs at random

Hedy can't print anything at random, because there is no list to choose from.

clubs is Manchester United, Bayrn Munchen, FC Barcelona
print clubs at random

Students try to use add/remove without a list

In the example below 'names' is not a list, but a variable. You cannot add anything to it.

names is Jake
your_name is ask Who are you?
add your_name to names
print names at random

There has to be a list first, so you have to add a second name to turn names into a list, for example Amy. If you don't want amy on your list, you can use remove to remove it after.

names is Jake, Amy
your_name is ask Who are you?
add your_name to names
print names at random

Students forget to use to/from in add/remove

Without to/from the add/remove command won't work.

adventures is story, parrot, dice
choice is Which adventure do you like best?
add choice
remove dice
print I love adventures at random

Hedy has to know which list the item should be added to/removed from.

adventures is story, parrot, dice
choice is Which adventure do you like best?
add choice to adventures
remove dice from adventures
print I love adventures at random

Level 4

Students forget to use quotation marks on both sides of the text

In this level print and ask need a set of quotation marks. One before of the text and one after.

print Hello
mood is ask 'How are you?

Add the correct quotation marks.

print 'Hello'
mood is ask 'How are you?'

Students use the wrong quotation marks

It is important to start your lesson by checking if the students know how to type a quotation mark properly. On Hedy, students might use single quotes ('') and double quotes (""). Backticks on the other hand, are not considered valid quotes (``).

print `Welcome to the restaurant`
food is ask "What would you like to order?"

These are the correct quotation marks:

print 'Welcome to the restaurant'
food is ask 'What would you like to order?'

Students use an apostrophe in their text

From this level on apostrophes are not allowed. They are often used in English when typing contractions like you're, don't or what's.

print 'You're not allowed to type this'

You can choose to use the wrong grammar and just leave the apostrophe out. Or you could use the ` as an apostrophe.

print 'Youre allowed to type this'
print 'And you`re able to do this'

Level 5

Students forget to use print in an if command

After students use if or else they forget to use a second command like print or ask.

if name is Hedy 'Great!'
else  Hedy is better!

Add the print command to fix it.

if name is Hedy print 'Great!'
else print 'Hedy is better!'

Students might use two different names for the same variable

In this example the student has used 'horse' and 'name' for the same variables.

horse is ask 'What is your horse called?'
if name is Bonfire print 'cool'
else print 'less cool!'

Always check whether the variable has the same name throughout the code. Slight differences can be hard to spot (for example plurals) but they will interfere with the code.

horse is ask 'What is your horse called'
if horse is Bonfire print 'cool!'
else print 'less cool!'

Students still forget the quotes on both sides

Using the if command can make the code lines very long and students tend to forget to use quotes.

if name is Hedy print fun
else print 'meh!

Always use 2 quotes in a print command.

if name is Hedy print 'fun'
else print 'meh!'

Students use quotes around variable names

In this level there are no quotes around variable names.

if  name  is 'Hedy' print 'fun'
else print 'meh!'

Remove the quotes to get the code to work.

if name is Hedy print 'fun'
else print 'meh!

Students use long variable names containing two or more words

Variables in Hedy can't contain spaces, so, in order to use together several words, students need to connect them using underscores (_)

chosen door is ask  Which door do you pick?

Add an underscore.

chosen_door is ask 'which door do you pick?'

Students want multiple answers to be correct

For example this student wants Hedy to tell all his friends that they are funny, while other classmates should be told that they are not.

if name is Jesse, David, Souf print 'You are funny' else print 'You are not funny'

You could use the in command for that. While it is explained in a higher level, it does already work in level 5. Another solution is to use multiple if commands and no else command. The disadvantage is that it won't tell the other classmates that they are not funny.

friends is Jesse, David, Souf
name is ask 'Who are you?'
if name in friends print 'You are funny'
else print 'You are not funny'

# or

name is ask 'Who are you?'
if naam is Jesse print 'You are funny'
if naam is David print 'You are funny'
if naam is Souf print 'You are funny'

The students make the variable name the same as the value in the if statement

In the example below the password is 'password'. This will result in it always being correct.

password is ask 'What is the password?'
if password is password print 'Access granted'
else print 'Acces denied!'

Pick a different name for your variable.

secret_password is ask 'What is the password'
if secret_password is password print 'Access granted!'
else print 'Access denied!'

Level 6

Students struggle with quotation marks

Some students struggle with adding quotation marks or not. If you add quotation marks, the output screen will literally show '5+5'.

print '5 + 5'

In this code the output screen will print '10'.

print 5 + 5

Students struggle with the concept of doing maths with a variable

Some students will find it hard to do maths with variables. Try to show them very simple examples, like:

age = ask 'How old are you?'
print 'Next year you will be ' age + 1

Or take it a step further like this.

price = 0
print 'Welcome to our burger restaurant'
burger = ask 'Would you like a burger?'
if burger = yes price = price + 10
drink = ask 'Would you like a drink?'
if drink = yes price = price + 4
print 'That will be ' price ' euros please'

Level 7

Students forget one of the word of the repeat command, or they forget the print command

Make sure that the students know to use both the full repeat command and the print command.

repeat 3 times  For he`s a jolly good fellow
repeat 3 print

This is the correct code:

repeat 3 times print 'For he`s a jolly good fellow'
repeat 3 times print 'Which nobody can deny!'

Students try to repeat multiple lines

In this level you can only repeat one line of code multiple times. In this code the student wanted to print 3 different drinks, but it won't work. It will ask the question 3 times and only print the last answer.

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

You should go to the next level to be able to repeat multiple lines. So on this level you'll have to print everything seperately.

drink = ask 'What would you like to drink?'
print drink
drink = ask 'What would you like to drink?'
print drink
drink = ask 'What would you like to drink?'
print drink

Students make programs that take too long to run

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?'

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

repeat 20 times print 'This is enough'

Level 8

Students use the indentation 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'

This is the correct code:

repeat 3 times
    print 'hello'

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

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

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

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!'

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

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?'

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

repeat 20 times
    print 'This is enough'

Students use the if command to check if the variable value is the same as the variable name

We've noticed a common error among our students: they try to create a program that checks for a password, but they make the password 'password'. In line 2 the computer is asked to check whether the variable password is the same as the variable password, so itself. Which means the answer is always yes. So with this code the answer will always be 'You can come in' no matter what the player fills in.

password is ask 'What is the password?'
if password is password
    print 'You can come in'
else
    print 'You are not allowed'

You can fix this mistake by adding quotation marks. This way the computer knows that the second password in if password is 'password' is a string value (so normal text) and not the variable name.

password is ask 'What is the password?'
if password is 'password'
    print 'You can come in'
else
    print 'You are not allowed'

Level 9

Students make mistakes with indentation

The hardest part about this level is getting the indentation right. Students love nesting if statements, sometimes even inside other nested if statements. Keeping track of indentation can get pretty tough.

print 'Robin is walking downtown'
location = ask 'Is Robin going into a shop, or does she go home?'
if location is shop
    print 'She enters the shop.'
    print 'Robin sees an interesting looking book'
    book = ask 'Does Robin buy the book?'
        if book is yes
print 'Robin buys the book and goes home'
else
    print 'Robin leaves the shop and goes home'
else
    print 'Robin goes home'

This is the correct code. Try to keep track of all the different constructions when putting if statements inside other if statements.

print 'Robin is walking downtown'
location = ask 'Is Robin going into a shop, or does she go home?'
if location is shop
    print 'She enters the shop.'
    print 'Robin sees an interesting looking book'
    book = ask 'Does Robin buy the book?'
    if book is yes
        print 'Robin buys the book and goes home'
    else
        print 'Robin leaves the shop and goes home'
else
    print 'Robin goes home'

Level 10

Students do not use the for command correctly

We often see that students try to print the list (in the example animals) instead of the items of the list.

animals is dog, cat, blobfish
for animal in animals
  print 'I love ' animals

The word animals in the last line should be changed into animal.

animals is dog, cat, blobfish
for animal in animals
  print 'I love ' animal

Students forget the indentation

Students tend to forget to use indentation after a for command.

animals is dog, cat, blobfish
for animal in animals
print 'I love ' animals

You should use indentation after a for command.

animals is dog, cat, blobfish
for animal in animals
  print 'I love ' animal

Level 11

Students forget to use indentation

Make sure that the students use indentation.

for i in range 1 to 5
print i

This is the correct code:

for i in range 1 to 5
    print i

Students don't understand the i

Some students don't understand that i is a variable. i is chosen, because it is used in Python programming, but you could just as easily use a different variable name. For example, this code:

for i in range 1 to 5
print i

Could just as well be replaced with this code. It works the same.

for banana in range 1 to 5
    print banana

Level 12

Students forget quotation marks

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!'

This is the correct code:

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

Students use quotation marks on numbers they want to use for calculations

You can use quotation marks on numbers, but only if you want the computer to think of them as text. This means you can't do calculations with the number. In the example below, you can't do maths with the number 25, because it's in quotation marks.

score = '25'
answer is ask 'Do you want a point?'
if answer is 'yes'
    score = score + 1
    print score

This is the correct code:

score = 25
answer is ask 'Do you want a point?'
if answer is 'yes'
    score = score + 1
    print score

Students use commas instead of periods in decimal numbers

Decimal numbers can be used from this level on, but you can't use commas.

print 2,5 + 2,5

This is the correct code:

print 2.5 + 2.5

Level 13

Students confuse and with or

Both commands might appear similar, but their functions are very different.

game is ask 'Do you want to play a game?'
time is ask 'Do you have time to play?'
if game is 'yes' or time is 'yes'
    print 'Lets play!'

In this case, the person should answer yes on both questions, so you should use and.

game is ask 'Do you want to play a game?'
time is ask 'Do you have time to play?'
if game is 'yes' and time is 'yes'
    print 'Lets play!'

Level 14

Students confuse the < and > signs

Often, students are already familiar with these signs from maths class. But if your students don't know these signs yet, they might have a challenge with it.

age = ask 'How old are you?'
if age < 12
    print 'You are older than I am!'

This is the correct code:

age = ask 'How old are you?'
if age > 12
    print 'You are older than I am!'

Students use the wrong signs for != <= and >=

These signs are probably new for most students. Make sure to explain these signs to your students.

name = ask 'What is your name?'
if name =  'Hedy'
    print 'You are not Hedy'

This is the correct code:

name = ask 'What is your name?'
if name != 'Hedy'
    print 'You are not Hedy'

Students forget to use the == sign

In this level, students are still allowed to use = or is. But on other levels, or in python, they might get in trouble for that. So it is best to train them to use it.

name = ask 'What is your name?'
if name = 'Hedy'
    print 'You are cool!'

This is the correct code:

name = ask 'What is your name?'
if name == 'Hedy'
    print 'You are cool!'

Level 15

Students forget indentation in the while loop

Indentation is often hard for students.

answer = 0
while answer != 25
answer = ask 'What is 5 times 5?'
print 'A correct answer has been given'

This is the correct code:

answer = 0
while answer != 25
    answer = ask 'What is 5 times 5?'
print 'A correct answer has been given'

Level 16

Students forget the brackets

From this level on lists should be in brackets.

icecream = 'starwberry', 'chocolate'
print 'I love ' icecream[random] ' icecream'

This is the correct code:

icecream = ['starwberry', 'chocolate']
print 'I love ' icecream[random] ' icecream'

Students use the wrong brackets

From this level on lists should be in brackets.

icecream = ('starwberry', 'chocolate')
print 'I love ' icecream[random] ' icecream'

This is the correct code:

icecream = ['starwberry', 'chocolate']
print 'I love ' icecream[random] ' icecream'

Students forget the quotation marks while focussing on the brackets

Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks.

icecream = [starwberry, chocolate]
print 'I love ' icecream[random] ' icecream'

This is the correct code:

icecream = ['starwberry', 'chocolate']
print 'I love ' icecream[random] ' icecream'

Students still use the old at random command

Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks.

icecream = [starwberry, chocolate]
print 'I love ' icecream at random ' icecream'

This is the correct code:

icecream = ['starwberry', 'chocolate']
print 'I love ' icecream[random] ' icecream'

Students forget the quotation marks while focussing on the brackets

Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks.

icecream = [starwberry, chocolate]
print 'I love ' icecream[random] ' icecream'

This is the correct code:

icecream = ['starwberry', 'chocolate']
print 'I love ' icecream[random] ' icecream'

Level 17

Students use elif like else, so without a condition

The elif command needs a condition behind it. It cannot be used like else, without a condition.

color = ask 'What is your favorite color?'
if color == 'green':
    print 'green is nice'
elif:
    print 'I like green'

This is the correct code:

color = ask 'What is your favorite color?'
if color == 'green':
    print 'green is nice'
elif color == yellow:
    print 'yellow is alright'
else:
    print 'I like green'

Students forget the colon

After each command that requires indentation, a colon should be used.

answer = ask 'How are you doing?'
if answer is 'great'
    print 'Me too!'
elif answer is 'bad'
    print 'Let me cheer you up!'
else
    print 'Im great!'

This is the correct code:

answer = ask 'How are you doing?'
if answer is 'great':
    print 'Me too!'
elif answer is 'bad':
    print 'Let me cheer you up!'
else:
    print 'Im great!'

Level 18

Students forget to use the brackets

Students will forget to put brackets around their text.

print 'my name is Hedy!'

This is the correct code:

print('my name is Hedy!')

Students will still use the ask command

The ask command has been used since level 1. So it might be hard for the students to switch to input instead of ask.

print('My name is Hedy!')
name = ask('What is your name?')
print('So your name is ', name)

This is the correct code:

print('My name is Hedy!')
name = input('What is your name?')
print('So your name is ', name)

Students might use the brackets as quotation marks

They have learned to keep the variables outside of the quotation marks, so they might do the same with the brackets. Which is not the correct way to use them.

temperature = 25
print('It is ') temperature ('degrees outside')

This is the correct code:

temperature = 25
print('It is ', temperature, 'degrees outside')