tags | language | level | type |
---|---|---|---|
logic, conditions, python, kids |
python |
3 |
lab |
This is a group/pair lab. Write out pseudo-code first!
WALL-E's microphone is broken and the only way he can hear you is if you shout at him!!
Write a speak_to_walle
method that accepts one argument: what you want to say to him. Whatever you say to WALL-E (whatever
you type in), he should respond with Dirrrrr-ect-tivvve?
, unless you shout it (type in all capitals). If you shout, he can hear you and yells back, EEEEEEEEEEEVAAAAAAAAAA!
.
###BONUS Too easy? Have WALL-E shout a different number each time you run the program; maybe any year at random between 1 and 100. (Hint: There is a python method that will generate random numbers.)
###DOUBLE BONUS
WALL-E really likes EVA. Change your program so that it keeps running until you shout BYE. (Hint: You will probably want to use a while loop
to keep the program running.)
###TRIPLE BONUS WALL-E really doesn't want you to leave! When you shout BYE, he pretends not to hear you. Change your program so that you have to shout BYE three times in a row before the program will end. Make sure to test your program: if you shout BYE three times, but not in a row, you should still be talking to WALL-E.