>> Hello everyone and welcome back to
the new intro to Python course on Siberia on-demand.
If you're here, that means you saw the intro video,
liked what you saw and decided to come back for more.
That is absolutely spectacular news for us,
and particularly for me.
I'm very excited to have you here and
>> I'm very excited to be teaching you this course.
>> Today, we're going to start with Lesson 0.
Lesson 0 is called Lesson 0 because in programming,
your very first lesson, we will always index from 0.
That is key to a lot of
different parts of computer science.
It's going to be very important to
know because if you mess that up,
you can actually break some pretty astonishing things.
Lesson 0 soapbox temporarily
over Lesson 0 is called some background.
Over the course of Lesson 0,
we're going to learn about the history of Python.
We're going to learn about the philosophy of Python.
I know that sounds a weird thing to say right now,
the philosophy of Python.
But it actually does have
an underlying underpinning philosophy
and we're going to talk about that,
and why it's important.
Then we're going to understand the core functionality
of Python, what it does,
how it does, what it does,
and why it works that way.
A very, very brief history of Python.
It was developed in 1991,
it was released in 1991.
It was developed by Guido Van Rossum
over the year preceding that.
Guido Van Rossum was quoted saying that he decided he
needed a project to keep him busy over the holidays,
and decided he would create a language to be
a spiritual successor to ABC,
which turned into Python.
He actually did this as
a side project just over the holidays,
I have gone to some extreme lengths to
avoid spending time with my family and in-laws before.
But I have to say I've never
invented a programming language.
That's pretty impressive.
Version 3 of the most current major version
of Python was actually released in 2008,
just over 10 years ago.
Version 2 is actually still in use in some places,
we're going to talk about a little bit here.
Version 2 of Python is used primarily in
organizations that are resistant
to change for some reason.
A lot of times it's the federal government,
sometimes it's big corporations that just have
a huge code base that they can't switch over.
There a lot of causes,
but fundamentally, it's been
more than 10 years now since Version 3 was released.
Version 2 was intended to be end-of-life,
I think a couple of years ago now,
and is now that got pushed back to
2020 for fear of messing up people's systems.
But it will be end of life around 2020.
It's really, really important that we use Version 3,
and then we upgrade to Version 3
because it really is an upgrade.
Version 3 is qualitatively superior to Version 2,
for a whole host of reasons.
Not least that it actually
better follows a lot of programming paradigms.
All of that said,
the reason I'm bringing it up and
the reason why I addressed it here is
because all of the code in this class and all of
the programming experience you will gain here,
will be in Python 3,
we will not use Python 2 at any point.
If you're in an organization that needs you to
learn Python 2, not the place.
By not the place, I mean not the organization.
Don't write Python 2 code it's not a good idea.
This slide is extremely information
dense and I just want to say,
don't try and read all of the material on this slide.
That's not at all what it's for,
and I don't want you trying to do that.
However, I wanted to put it up here and it'll be
in your supplemental material as
well in a more readable format because there are
a few specific lines that I want you to see,
and I want to address here.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Those three aphorisms are self satisfying statements.
Statements that are self-contained and they
are a single point of truth or belief.
Those are all contained in the Zen of Python,
which is PEP 20, which is actually
a Python guiding document.
The idea here is that this list
of concept or this list of ideas,
governs all of the development of Python,
and governs all of the concepts that are built
into the language that make it function
the way it does today.
The three that I addressed,
explicit is better than implicit,
simple is better than complex,
and complex is better than complicated,
are not only the first three lines,
but they're my three favorite lines.
They're really important to this course,
and really any Python programming you'll do.
Because of the fact that when you're writing code,
more rather when you're working with code,
more often you're going to be
>> reading it than writing it.
>> You only write a program once,
maybe a couple of times if you're
rebuilding it for some reason.
But you're going to write
the code once and then you're going to have to
read it over and over again to sustain it,
to fix it, to supplement it,
other people are going to come along and have to
read your code and try and understand what it does.
Python was intended to be a
>> very human-readable language.
>> When you're writing Python
code you should keep that in mind.
Sometimes you can't avoid having complex code,
but if you have to write complex code,
it's better to write a couple of lines of
complex code and then write
a bunch of comments to explain it,
than it is to have some behemoth monster,
thousands and thousands of lines of
Python code that don't make any sense.
Simple as always, the best option.
But if you can't be simple,
at least don't be complicated.
Or again, this is a very information dense slide.
It's very small, it's hard to read.
This is mostly just here to illustrate.
It's not here for you to try and read through.
The Zen of Python PEP 20 will
be in your supplemental materials.
The design of Python, how
it actually works under the hood.
We're not going to get super,
super technical with this because this
is an intro level course.
But essentially what matters here for people
who've worked with programming languages before,
we've had to do like memory management
in C or garbage clean up.
All of that is handled under the hood in Python,
you don't have to use malloc,
you don't have to associate virtual memory,
all of that is handled for you.
Python is a relatively secure language
in terms of memory safety,
because of the fact that it takes it out of users hands.
It's a relatively memory-safe language,
and it's going to do most of that hard work for you.
Python functions on what's called a REPL.
There are people who would call that a REPL loop.
Those are the same monsters who say things
like ATM machine and pin number.
REPL stands for read execute print loop.
It's not a REPL loop, it's
just a REPL period or a REP loop if you must say loop.
I understand that this is not
important and it doesn't matter.
But it does matter to me because I'm
a pedantic person and this is important to me.
[LAUGHTER] But more seriously,
REPL read execute print is the way that
the Python implementation interprets your code,
the way the interpreter interprets
your code, that's what I was looking for.
It will read a line of code.
It will gain the context of that line if it needs
other lines for more information
or if it needs other data,
it will then execute that turn into machine code,
give it to your system that actually run,
and then it will print the results.
Now, that's in the interpreter,
if you're writing a Python script,
it will not print every line.
A lot of time
in script it's only going to print when you tell it to.
On the interpreter side,
if you're assigning the result to a variable,
it's not going to print to the screen,
because it's being piped to that variable.
But the concept still stands.
It reads, it executes,
and it outputs that information
either to print or to some other storage location.
There are coding conventions in the Python and we will to
some extent address them during the syntax lesson.
However, we are not going to
spend a whole bunch of time on them
because this is actually
another quote from Guido Van Rossum.
A foolish consistency is the hob goblin of little minds,
which is to say that it is more important to write
clear readable code that
matches the style of whatever project you're on,
than it is to match every single detail
of the Python coding convention.
It is more important that your code be easy
to use and easy to understand,
than that you use exactly the right cases for everything.
The coding conventions are useful and I like to
follow them and you should follow
them, and feel free to read them.
You can see that they're on the slide
>> as a link and supplemental materials.
>> We'll also include that link,
but they're not laws, they're guidelines.
A knowledge check,
what does REPL stands for?
I'll give you just a couple of seconds.
Read execute print loop.
I don't put loop there because I want to
specify it is a read execute print,
and that is being done in a loop.
Which PEP covers the Zen of Python?
PEP 20. Which PEP covers the Python conventions?
I actually don't know that I said it out loud,
but that is going to be PEP 8.
Like I said, it's not actually
terribly, terribly important.
It's useful and it's good to know and you
should learn it and you should look up
>> PEP 8 and read it.
>> But it's much more important that you write
functional, easy to read code.
That's all there is for Lesson 0.
When you come back to Lesson 1,
we're going to discuss programming basics, logic.
We're going to really dig into some
Boolean logics, some truth tables.
We're going to have a great time over the course
of this lesson as
our knowledge check suggested
we learned about the history of Python,
we learned about the fundamental workings of it.
Of course, we learned that it is much more
important to be easy to read than it is to be pretty.
Thank you all very much and I look
forward to seeing you in the next video.