## Learning Python: Child's Play with RUR-PLE!

###### André Roberge, © 2004, 2005, 2006

The following is a list of all available lessons.

### Part 1. Welcome to Reeborg's world.

In this first part, we start our learning adventure in Reeborg's world. We will learn how to write some simple computer programs.

- 1. About the browser
  This first lesson briefly describes the browser included within RUR-PLE.
- 2. Reeborg explores its world
  In this lesson, you will start getting familiar with Reeborg's environment and learn to use arrows on the keyboard to make Reeborg move.
- 3. First program
  This lesson what we mean by computer program and introduces two instructions for Reeborg: `move()` and `turn_off().`
- 4. Dealing with eRRoRs
  Learning about the case sensitivity of Python.
- 5. Any comments? Avez-vous des commentaires?
  We learn how to add additional explanations meant only for humans in programs. These are called comments. We also learn about translating the instructions obeyed by Reeborg into other human languages using synonyms. This is closely related to the concept of variables which will be introduced much later.
- 6. Making a left turn
  We learn about another instruction for Reeborg: `turn_left().`
- 7. Beepers
  We learn about beepers and the last two commands that Reeborg can obey: `pick_beeper()` and `put_beeper()`.
- 8. Darn bugs!
  In this lesson we learn about bugs and how RUR-PLE can help us find and quash them.
- 9. Building walls
  We learn how to add or remove walls in Reeborg's world; this lesson concludes with a few programming challenges.

### Part 2. Reeborg knows Python.

In this second part, we will learn our first Python keywords and how we can use them to help Reeborg accomplish various tasks of increasing difficulty while making it easier for us to write programs.

- 10. Definitely avoiding repetitions
  In this lesson, we learn our first python keyword: def.
- 11. Avoiding repetitions, again!
  Here, we learn how Reeborg can repeat instructions automatically.
- 12. If only Reeborg could decide on his own ...
  In this lesson, we learn our second Python keyword: if.
- 13. Listen to me ... or else ....
  In this lesson, we learn our third Python keyword: else.
- 14. If, else, if, else, ....
  In this lesson, we learn our fourth and fifth Python keywords: elif and pass.
- 15. Not true!?
  In this lesson, we learn our sixth Python keyword: not.
- 16. For a while
  In this lesson, we learn our seventh Python keyword: while.
- 17. Amazing - part 1
  We put together all we've learned so far to solve a series of exercises, with a surprising conclusion.
- 18. Amazing - part 2
- 19. Amazing - part 3
- 20. Amazing - part 4
- 21. Amazing - part 5
- 22. It's raining!
  Help Reeborg close the window in his house to prevent the rain from coming in.
- 23. After the storm
  Help Reeborg clean up his yard after a wind storm.
- 24. Teaching Reeborg to add.
  We teach Reeborg how to add two numbers on his own. After this lesson, we will temporarily leave Reeborg's world to learn more about Python itself.

### Part 3. Python, the interpreter.

In this third part, we will learn about the Python interpreter. We will also learn about numbers, strings, lists, tuples and dictionaries. This third part is very similar to a traditional beginner's tutorial to Python ... except that we can still have fun with Reeborg!

- 25. Python already knows how to add.
  In this lesson, we explore how Python adds, subtracts, multiplies, divides, ..., numbers.
- 26. Interpreting the Python keywords In this lesson we explore how the Python interpreter deals with a few of the Python keywords that we already know.
- 27. Variables In this lesson, we introduce the very important concept of variables
- 28. Variables and functions In this lesson we will see how we can use functions and variables together.
- 29. What's your name? In this lesson, we learn to use variables to represent strings. We also learn about slicing.
- 30. Object-Oriented Programming: "dot" notation In this lesson we will learn about the "dot" notation that is used commonly in Object-Oriented Programming languages. We will also learn something new about Reeborg's world.
- 31. Globalization is a bad thing. In this lesson, we will learn a new Python keyword: global.
- 32. Many returns In this lesson we learn about a new Python keyword, return, so that we can write even more useful functions.
- 33. Repeat() is hiding some Python keywords In this lesson, we learn about two new Python keywords that we have briefly seen before: for and in.
- 34. Chocolate mousse cake recipe In this lesson we learn about Python lists, see how we can find out all the method for a given Python object, learn about a new keyword, del. We also learn something new about the function `range()`.
- 35. An other kind of definition In this lesson we learn about Python dicts, as well as the built-in function `str()`.
- 36. Our last sequence In this lesson we learn about Python tuples, as well as the difference between mutable and immutable objects.
- 37. Fixing up Reeborg An introduction to the idea of creating a new class by inheriting from an existing one.
- 38. A touch of class Two more subclassing examples in Reeborg's world.
- 39. Avoiding repetitions - the important stuff
  We will learn about importing modules.
- 40. Random escapes We look at two relatively simple programs that rely on random turns and moves to find the exit from a maze. The first one checks for the presence of a wall in front and moves only if there is none present. Example of Look before you leap.
  The second catches exceptions (rather than checking for the presence of a wall). Example of Better to ask forgiveness than permission.
  This lesson introduces the Python keywords try, except, and raise.

### Advanced lessons

The following lessons are presented as individual topics, each more or less standing on its own. They are meant to be the beginning points of some further exploration, or useful for teachers.

- 41. A Robotic Fairy Tale A review exercise presented as a Fairy Tale.
- 42. Octal, hexadecimal and binary numbers In this lesson, we have a brief look at binary, octal and hexadecimal numbers.
- 43. Sorting Some suggested sorting exercises in Reeborg's world.
- 44. Reeborg asks you; to do
- 45. Using custom made images: to do.
- 46. Using the built-in editor: to do
- 47. Using Lightning Compiler: the basics. to do
- 48. Using Lightning Compiler: doctests

### Appendix

Summary of instructions
About RUR-PLE
Acknowledgements