Hi, my name is Dave Andrews. Today I’m going
to show you how to program a computer. There’s a lot of ways for beginners to break into
programming. Some people say you should use Java, other people say you should use C .
But I’m going to show you how to use a programming language called Python which I think is the
easiest for beginners who are getting started. To get going with Python, if you can see my
computer, basically just point your web browser to Python.org. Now once you have Python installed,
let’s write a simple program by clicking on your start button, going to all programs.
Let’s find Python two point six and just run Python command line. Now this pulls up a simple
Python interpreter, meaning Python is an interpreted language, and that means that it basically
figures out what it’s going to do as it’s going over the line of code, as opposed to
being a compiled language which is compiled into machine programming and just executed
natively. Let’s type in a simple program here. I’m going to show you how easy it is to program
in Python. I’ll say for i in range zero to twenty, and this basically says create a variable
called i, and we’re going to loop it from zero to twenty. Therefore i will be zero,
then i will be one, then two, then three, on up until twenty. Type a colon, and then
your enter. Now let’s do a tab here, and we’re going to say print hello exclamation point
and make sure that’s enclosed in quotation marks. Then space. Say plus. And then a STR
for string. We’re going to convert i to a string, and that’s what you have to do in
order to print it out with other text on the screen. Then another plus, and then say i
times twenty is equal to… let’s close our quote, then another plus. I’m going to say
string again, i times twenty, that asterisk means multiplication. So basically we’re going
to print out the text hello twenty times and then the number that i currently is and then
multiply i times twenty and print out what that is. I’m going to put a little space here
after my hello so we can read it a little better. Say enter and say enter again. Now
i as you can see has looped from zero to twenty, and it’s saying it didn’t include twenty.
It’s important to keep in mind. See i times twenty is zero, if i is ten, then i times
twenty is two hundred. It just shows you how easy it is to kind of crunch some numbers
in a programming language. Just search the internet for Python tutorials, you can find
a whole lot more interesting stuff than this. My name is Dave Andrews and I’ve just showed
you how to program a computer.