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 codes get longer and longer as the levels progress. That's why we've made a list with frequently made mistakes in each level, and their solutions.
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!
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!
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
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...
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 doesn't work. Even though it does work, you can't see it happening off screen. Use smaller numbers to prevent this from happening.
forward 100 turn 90
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
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!
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?
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 varible instead.
answer is ask Why doens't echo work anymore?! print answer
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
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?
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
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}
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}
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}
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}
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
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}
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}
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 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?'
It is important to start your lesson by checking if the students know how to type a quotation mark properly. Else they might use the "double quotes" or the skewed one `.
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?'
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'
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!'
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!'
Codes using the if
commando can get 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!'
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!
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?'
For example this student Hedy to tell all his friends that they are funny, but other classmates would 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. It is explained in a higher level, but 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'
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!'
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
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'
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!'
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
In this level it's very easy to make long codes. The students aren't allowed to make programs that take to long to load (to save our servers).
repeat 100 times print 'How many times can I repeat this?'
Make sure the codes aren't too long
repeat 20 times print 'This is enough'
Indentation is a new concept in this level, that is hard to use for some students. Make sure they practise some simple codes before making a whole program with it.
repeat 3 times print 'hello'
This is the correct code:
repeat 3 times print 'hello'
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
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!'
In this level it's very easy to make long codes. The students aren't allowed to make programs that take to long to load (to save our servers).
repeat 100 times print 'How many times can I repeat this?'
Make sure the codes aren't too long
repeat 20 times print 'This is enough'
We have seen this mistake by some of our students. They make a password for their computer, 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'
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'
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 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
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
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
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!'
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
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
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!'
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!'
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'
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!'
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'
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'
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 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 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 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'
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'
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!'
Students will forget to put brackets around their text.
print 'my name is Hedy!'
This is the correct code:
print('my name is Hedy!')
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)
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')