Lesson 2

This is Python Lesson 2

In this lesson we will develop the skills we learnt in the last lesson.  Also we will learn about variables and how to print them. In this lesson and in fact all of our lessons you have to type carefully so check your code again and again!

What is a variable? Well a variable is simply a thing that can store information. For example:

Now in this case the variable (above) is PythonStar, so we say PythonStar = 10. So the variable stores the number 10. The output of the code would be ’10’. Now the next line includes the print command we used last lesson but you might have noticed the speech marks have gone, that is because we do not use speech marks when it is a variable. If we had used speech marks the output would have been ‘PythonCoders’. Now you have learnt how to print basic variables, experiment with what you can do.

            Next