Choose a random word from a group with at and random.
add an item to a list.
remove an item from a list.
Parrot
Dishes?
Turtle
debugging
Quiz
Teach your parrot a new word with add.
Exercise
Can you add the add to command to get the code to work?
words is squawk, Hedy
print Train your parrot!
new_word is ask Which word do you want to teach them?
_ new_word _ words
print 🧒 Say new_word, Hedy!
print 🦜 words at random
Do you always disagree at home about who should wash the dishes or change the litter box today?
Then you can let the computer choose very fairly. You can program that in this level!
people is mom, dad, Emma, Sophie
print people at random has to do the dishes
Exercise
Make your own version of the dishwasher program. Firstly make a list of your family members.
Then think of a task that needs to be done, and let the computer decide who has to do the task with the at random command.
Extra Don't feel like doing the dishes yourself? Hack the program by removing your name from the list with the removefrom command.
In this level you can use at random with the drawing turtle. A random choice makes the turtle walk a different path each time.
Use at random to choose a value from a list.
Exercise
Can you copy and paste lines 2 and 3 to create a longer random path?
angles is 10, 50, 90, 150, 250
turn angles at random
forward 25
Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code.
That means that in these debugging adventures, we will give you a code that does not work yet.
You will have to figure out what's wrong and correct the mistakes.
Exercise
Debug this code. Good luck!
Warning! This code needs to be debugged!
movie_choices is dracula, fast and furious, home alone, barbie
chosen_movie is movies at random
print Tonight we will watch chosen _movies
like ask Do you like that movie?
print Tomorrow we will watch something else.
add chosen_movie to movie_choices
print Tomorrow we will watch tomorrows_movie
tomorrows_movie is movie_choices at random
I'll go get the popcorn! print
Quiz Level 3
→
←
Search...
This program has been successfully submitted and can't be edited anymore.