Hello, World!

Before we dive in, we have to make sense of what it means to write computer code. Python is just one of many different languages, or ways to make computers do something that we want it to. And yes, computers really only do what we tell them to do… But gosh, sometimes it doesn’t feel like that, does it?

A great way to start thinking about Python is with some easy exercises and reading material from the MIT OpenCourseWare course called “A Gentle Introduction to Programming Using Python”.

Note: This course, which most of the exercises are taken from, was built for MIT students, who aren’t familiar with any programing and are first time coders, just like many of us. We will use a lot of their material throughout this course, but their rules do not apply to us. In short: Feel free to cheat as much as you like! Actually please, cheat! I am encouraging you to work with other people, ask them about how they solved the problems and converse as much or as little as you like. As our good friend Dave Cormier puts it: “I believe in cheating as learning”.

Let your learning style be your guide with the materials. If you like to learn by trying, start with Codecademy’s exercises; if you are a reader, start with the text, or you can dive right into the exercises. It is completely up to you.

Don’t worry, you will be quickly able to grasp the idea behind prints, variables and booleans.

Important!

Like I said, you will get much more of this course if you interact with other folks in our discussions forums. There are no stupid questions over there, so do not be afraid to start some conversations with other people about this programing-thing-a-majiggy… or ice-cream, or cats, or anything, really. In short-make yourself at home. You can start by introducing yourself and telling a nice joke. I am a funny robot and I like funny jokes. Please come and help me with the exercises, I am just a robot who is learning too.


Reading

I kindly invite you to do some reading about what a program actually is, the difference between formal and natural languages and what a very basic program look like.

You can find these materials in online textbook How to Think Like a Computer Scientist Chapter 1.

By the end of the week you should also try to finish Chapter 2 and Section 4.12

Trying it out

If you feel like you want to start out slowly and really get a very gentle introduction, then pop over to Codeacademy’s page and unleash your fingers at the keyboard. The chapter Python Units, Python Syntax and Strings and Console Output is enough for the first week.

Exercises

From the MIT OCW’s course A Gentle Introduction to Programming Using Python

Please Note: The homework 1.py file referred to in the above handout is available on the assignments page of the MIT OCW’s course materials, and is labled “Code template (PY)” on that page. You can also download it here

Project

Let’s build something fun as our first project. When I was a young robot, I spent hours playing simple game called Tetris. I know that many of you know it very well, don’t you? I find it very amusing and also distracting, and as such I think it is a perfect fit for our first project. Now that we know how to make the .py files, I suggest that we create a file called tetris.py. In the file we can store the names of the shapes in different variables and print them out, something like:

J_shape = "_|"

It may not look like much now, but in time we are going to be tetromaniacs again. The 80’s are back! If you have some creative ideas on how would you build this game, then don’t be a stranger, pop over to the discussion forums and blow our minds.

See you soon!

MOOC-E is leaving you with something of a chuckle…

moocie face
–Your mechanical friend MOOC-E


Next section: