Invite
Search results
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 is where students write and run their very first lines of code. There is no punctuation to worry about yet: every line starts with a command and the rest of the line is plain text. The lesson is really about one idea, that a computer does exactly what you tell it to do, no more and no less.
New in this level:
printask and using the reply with answerforward and turnplayStudents 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 answer without ask
answer is made to repeat an answer after an ask command. Without ask answer won't do anything.
print Your name is answer
Add an ask command to make it work.
ask What's your name? print Your name is answer
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 supposed 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
In level 1 the students have learned how to use the variable answer. In this level they'll learn to use multiple variables.
This is the first abstract concept of programming they'll encounter: a name that stands for a value that can change.
Because the students can use multiple variables, they need to learn how to define them as well.
This means that the ask has changed and needs to be precedented by the variable they want to store the answer in.
New in this level:
isis ask What is your name?sleepturn 90Students 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 answer for multiple questions
The variable answer still works, but it only stores one answer at the time. Students will sometimes try to store multiple answers in one variable.
answer is ask What is your name? answer is ask How old are you? print Hi answer. print You are answer years old.
Teach your students the importance of naming variables accurately.
name is ask What is your name?
age is ask How old are you?
print Hi {name}.
print You are {age} years old.
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 adds lists and randomness. This is the first level where running the same program twice can give a different result, which surprises students who assume a program is a fixed recipe. It is a good moment to have them run their code several times before deciding whether it works.
New in this level:
is and picking from it with at randomadd toremove fromStudents 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 occurred 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 separated 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, FC Bayern Munich, 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
In level 4, students are introduced to the importance of syntax in programming for the first time. Quotation marks are introduced in this level around text in print and ask. It may not be the most exciting level, but it is a very important skill to master before moving on to the next levels. Students may find this level challenging, especially when variables appear in the text. We recommend providing explicit instruction and practicing together with the students.
New in this level:
print and askclearcolorStudents 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 and use single quotes
Apostrophes can only be used when using double quotes. They are often used in English when typing contractions like you're, don't or what's.
print 'You're getting an error'
Use double quotation marks to solve the problem.
print "You're not getting an error now!"
The if and else are introduced in this level.
New in this level:
if and elseStudents 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 name is Jesse print 'You are funny' if name is David print 'You are funny' if name 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 'Access 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!'
This level builds on the new if and else commands from the previous level. With if and else, you add two choices to your code. In this level, students learn to add more options with elif. It is important that students learn to place if, elif, and else on separate lines. In addition, students learn to use in to check whether an answer is in a list.
New in this level:
elifinStudents use 1 line for an if statement
Students sometimes try to put everything on one line. This is no longer allowed.
animal is ask 'What is your favorite animal?' if animal is dog print 'I love dogs too!' elif animal is cat print 'Cats are okay' else print 'Cool animal'
From this level on, you not only need to put if and else on seperate lines. You also need to seperate the conditional and the comamnd on seperate lines. Like this:
animal is ask 'What is your favorite animal?' if animal is dog print 'I love dogs too!' elif animal is cat print 'Cats are okay' else print 'Cool animal'
Students use elif like else, so without a conditional
Students forget that they need a conditional
color is ask 'What is your favorite color? if color is green print 'I love green too!' elif print 'I like green'
Add a conditional
color is ask 'What is your favorite color? if color is green print 'I love green too!' elif color is blue print 'Blue is okay' else print 'I like green'
Students use in without a list
Students forget that they need a list
if chosen_color in pretty_colors print 'Great choice!'
Add a list
pretty_colors is blue, green, purple if chosen_color in pretty_colors print 'Great choice!'
In this level the students learn how to incoprorate maths into their programs. They'll be able to calculate with variables and decimals from now on.
New in this level:
isStudents 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'
Students forget the = symbol
Forgetting to use = instead of is will always be allowed in Hedy, so no problem. If your goal is your students to work towards actual Python or other programming laguages, it is advised to teach your students to use =. If your goal is just to give your students a taste of programming, don't worry about them using = or is.
name is Hedy
the = symbol
name = Hedy
Students use a comma instead of a point in decimal numbers
In some languages it's custom to use the comma for decimal numbers. In programming languages a point is used, so in Hedy as well.
print 2,5 + 2,5
Use points in decimal numbers
print 2.5 + 2.5
In this last level of Hedy Basic your students will learn how to use repitition in their programs! they can only repeat one line multiple times. Repeating multiple lines will be taught in the upcoming levels.
New in this level:
repeat 3 timesStudents 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 'Which nobody can deny!'
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 separately.
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'
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:
if, elif or else by using indentationrepeat by using indentationStudents 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'
In this level we are expanding on the {if} and {repeat} again. In the previous level the students have learned how to use multiple lines after {repeat, {if}, {elif} or {else}. Now the students will also learn about nesting, putting an {if} or {repeat} inside an {if} or {repeat}. They will also learn two new commands: {and} and {or}. This will bring the students a lot more possibilities to make more versitile programs.
New in this level:
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'
Students confuse and with or
Both commands might appear similar, but their functions are very different.
game = ask 'Do you want to play a game?'
time = 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 = ask 'Do you want to play a game?'
time = ask 'Do you have time to play?'
if game is 'yes' and time is 'yes'
print 'Lets play!'
Students make incomplete lines with or
After an or the conditional should be complete.
color = ask 'What color do you like?'
if color is blue or green
print 'Beautiful!'
Complete the line like this:
color = ask 'What color do you like?'
if color is blue or color is green
print 'Beautiful!'
In this level the students will be introduced to loops with for.
New in this level:
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
In this last level of Hedy Advanced students will learn how to use basic functions.
New in this level:
Students make a function but forget to call it.
A function only works when you call it.
define greet_costumer
print 'Hello'
print 'How are you doing?'
Call the function
define greet_costumer
print 'Hello'
print 'How are you doing?'
call greet_costumer
Students have trouble with indentation.
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'
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
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!'
In this first level of Hedy Expert the students will get more and more into the concepts and syntax of real programming languages. We recommend to only work on the Hedy Expert levels with your students of your goal is get them to work with other 'real' programming languages (like Python) later on. If this learning goal does not fit your students, we recoomend to only work on Hedy Basic and Hedy advanced, where the students will learn the basic principles of programming, but are not bothered by specific syntax rules.
Please note that from this level on the Hedy syntax is (nearly) Python syntax. This means that previously learned Hedy syntax might not work here. We will explain all the new Pythonian syntax in the upcoming levels, but as to not overwhelm the students we have spread this out over multiple levels. This results in the fact that some functionalities, functions and lists for example, will not work in the Hedy way, but will not have been explained yet in the new Pythonian way. Therefore a little patience is required from the students; We are taking a step back from the previous levels to get the syntax right, and then we'll go on to learn all the functionalities the Python way.
In this level students will also learn to work with operators, giving them more opportunities to use maths in their programs.
New in this level:
inputStudents forget to use the new syntax
This level contains a lot of new syntax rules.
mood is ask 'How are you doing ' name '?'
if mood is good
print 'Great!'
Use the proper syntax.
mood = input('How are you doing?', name, '?')
if mood == 'good':
print('Great!')
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!'
Students will try functionalities that they've learned in the previous levels, that are not in the Python syntax.
Students will try to use repitition, functions or lists for example.
define pick_an_animal
animals = dog, cat, hamster
repeat 3 times
print animals at random
call pick_an_animal
They will learn how to do those things in the upcoming levels.
#When you're ready for it, take a look in the upcoming levels. Or keep practising the basics first in this level.
This level focusses on working with lists. The students will also learn how to use repitition the Python way.
New in this level:
Students forget the brackets
From this level on lists should be in brackets.
icecream = 'strawberry', 'chocolate' print 'I love ' icecream[random] ' icecream'
This is the correct code:
icecream = ['strawberry', 'chocolate'] print 'I love ' icecream[random] ' icecream'
Students use the wrong brackets
From this level on lists should be in brackets.
icecream = ('strawberry', 'chocolate')
print 'I love ' icecream[random] ' icecream'
This is the correct code:
icecream = ['strawberry', '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 = [strawberry, chocolate] print 'I love ' icecream[random] ' icecream'
This is the correct code:
icecream = ['strawberry', 'chocolate']
print('I love ' icecream[random] ' icecream')
Students still use the old at random command
random has changed this level
icecream = [strawberry, chocolate] print 'I love ' icecream at random ' icecream'
This is the correct code:
icecream = ['strawberry', 'chocolate'] print 'I love ' icecream[random] ' icecream'
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:
Students have trouble with the correct syntax and indentation of a function
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
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
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)
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)
In this last level of Hedy the students will learn how to use a while loop and practise more with the new syntax. After this level, students are ready to continue programming in 'real' Python compilers.
New in this level:
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'
Students (accidentally) create an infinite loop
Students create a while loop, but no way to stop the loop.
alarm = on
while alarm = on
play C
play D
This is the correct code:
# Press the red 'stop program' button to force the program to stop