Tip:
Highlight text to annotate it
X
[D. Evans] Let's get started with programming.
Programming is really the core of computer science.
Most machines are designed to do just one thing.
This is supposed to be a toaster.
It's more of a representational drawing than an accurate one.
A toaster - well, we can do more than one thing with a toaster maybe.
We can put different things in it.
We can toast bread, we can toast muffins.
Maybe it has some things we can use to change its behavior a little bit.
We can turn a setting to make it toast for longer or shorter.
But it's pretty limited what it can do.
Everything it can do is a variation on this basic functionality that it was designed for,
this basic process of putting toast in, heating it up, and getting the toast to pop out.
If we want to change its behavior to do something really different,
we'd have to physically alter the machine.
We could maybe take the parts out, put them together in a new way.
If we're really creative we could make a bicycle from the toaster.
That would be a pretty big project, though.
So without a program, a computer is even less useful than a toaster.
Can't do anything without a program.
The program is what tells the computer what to do.
And the power of a computer is that, unlike a toaster,
which is really designed to only do a few things,
a computer can do anything.
A computer is a universal machine.
We can program it to do essentially any computation.
So anything that we can imagine,
anything that we can figure out how to write a program for,
we can make the computer do.
And what the program needs to be is a very precise sequence of steps.
The computer by itself doesn't know how to do anything.
It has a few simple instructions that it can execute.
And to make a program do something useful,
we need to put those instructions together in a way that does what we want.
So we can turn the computer into a web browser, into a server,
into a game-playing machine, into a toaster without anywhere to put the bread,
but into anything that we can imagine - at least any computation we want to do.
And the power of the computer is that it can execute those steps super, super fast,
so we can execute billions of instructions in one second.
The program gives us a way to tell the computer what steps to take.
There are many different languages for programming computers.
The language we're going to learn in this course is a language called Python, like the snake.
It's also named after Monty Python.
The important thing about Python is it gives us a nice high level language
that we can use to write programs.
And that means instead of our program running directly on the computer,
the programs that we write will be an input to the Python program,
which runs on the computer.
What Python is is called an interpreter.
That means it runs our programs, it interprets them,
executes the program that we wrote in the Python language
by running a program in the language that the computer can understand directly.