Time
2 hours 57 minutes
Difficulty
Beginner
CEU/CPE
3

Video Transcription

00:00
Hello, everyone. And welcome back to the new interest of Python course here on Cyber Eri on demand. If you're here, that means you saw the intro video, liked what you saw and decided to come back from or not 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
00:17
today. We're gonna start with lesson zero. Lesson zero is called less than zero. Because in programming,
00:21
your very first lesson we will always index from zero. That is key to a lot of different. A lot of different parts of computer science. And it's going to be very important to know, because if you mess that up, you can actually break some pretty astonishing things. So lesson zero soapbox temporarily over Lesson zero is called some background.
00:38
Over the course of lessons here, we're gonna learn about the history of pie Thought were to learn about the philosophy of python. And I know that sounds like a weird thing to say right now, the philosophy of python, but it actually does have an underlying underpinning philosophy, and we're gonna talk about that and why it's important
00:52
that we're gonna understand the core functionality if I thought what it does, how it does, what it does and why. It's why it works that way.
01:00
So a very, very brief history of python it was developed in 1991 was released in 1991 was developed like Guido Van Rostam over sort of the year preceding that. Guido von Droste was quoted as 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,
01:18
which could be, you know, which which turned into Python. He actually did this as a side project just over the holidays. I have gone to such extreme lengths to avoid spending time with my family and in laws before. But I have to say, I've never I've never invented a programming language, so that's pretty impressive.
01:36
Version three, the most current major version of Python, was actually released in 2008 just over 10 years ago.
01:41
Version to is actually still in use in some places,
01:45
you know, we're gonna talk about a little bit here. Version two of Python is used primarily in organizations that are resistant to change. For some reason, a lot of times 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,
02:01
it's been more than 10 years now, since version three was a released version. Two is intended was intended to the end of life a couple of years, 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. So it's really, really important
02:19
that we use version three and we upgraded version three because it really is an upgrade. Version three is qualitatively superior diversion to
02:24
for a whole host of reasons, not least that it actually
02:28
better follows a lot of programming paradigms.
02:30
All of that said the reason I'm bringing it up in the reason why address here, because all of the code in this class and all of the pro programming experience will gain here will be in Python three. We will not use python to at any point. So if you're in an organization that needs you to learn Python to not the place and by not the place, I mean not the organization.
02:49
Don't write python to code. It's not a good idea,
02:53
So this slide is extremely information dense on. 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 will be in your supplemental material as well in a more readable format, because there are a few specific lines
03:10
that I want you to see and I want to kind of address here.
03:14
Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. So those three of those three aphorisms are sort of self, self
03:24
satisfying statement statements that are sort of 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 this list of concept or this list of ideas
03:40
governs all of the development of python. It governs all of the concepts
03:45
they're built into, the language that make it function the way it does today. And so 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 1st 3 lines, but they're my three favorite lines. And they're really important to this course. And really any python programming you'll do because of the fact that
04:01
when you're writing code MME. Or rather when you're working with code more often, you're going to be reading it in writing it. You only write a program, you know, once, maybe a couple of times if you're rebuilding it for some reason.
04:13
But you're gonna write the code once, and they're gonna have to read it over and over again to sustain it. To fix it to supplement it. Other people are gonna come along and have to read your code, try and understand what it does. And so python was intended to be a very human readable language. And when you're writing, python could keep that in mind. Sometimes you can't avoid having complex code.
04:30
But if you have to write complex code, it's better to write,
04:33
You know, 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. You know, thousands and thousands of lines of python code that don't make any sense. Simple is always the best option. But if you can't be simple, at least don't be complicated all again. This is a very information. Don't slide. It's very small. It's hard to read.
04:53
This is mostly just here to illustrate. It's not here for you to try and read through
04:57
the Zen A python Pep 20 will be in your supplemental materials.
05:00
So the design of python, how it actually works under the hood. We're not gonna get super Super technical with this because this is an intro level course. But essentially what matters here for people who understand who worked with programming languages before I had to do, you know, like memory management didn't see your garbage clean up? All of that is handled under the hood and python.
05:15
You don't have to use Malik. You don't have to, you know associate virtual memory. All of that's handled for you.
05:20
Python is a relatively secure language in terms of memory safety because of the fact that it kind of takes it out of the user's hands. It za relatively memory safe language, and it's gonna do most of that hard work for you by phone functions on what's called a rebel. There are people who would call that a rebel loop those air the same monsters who say things like a T M machine and pin number.
05:41
Rebel stands for Reed Execute print loop. So it's not a ripple loop. It's just a rebel 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 am a pedantic person and this is important to me.
05:55
But more seriously, rappel, read, execute Print is the way that the actual in the python implementation interprets your code the way the Interpreter Interpreter Co. 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. If it needs other data. It will then execute that turn into Michigan. Go give it to your system to actually run,
06:15
and then we'll print the results. Now that's in the interpreter of your writing. A Python script will not print every line
06:19
a lot of time. Well, in script, it's only gonna print when you tell it to.
06:24
And on the interpreter side. If you're assigning the result toe 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.
06:39
There are coding Convention the python, and we will to some extent address them during the syntax lesson. However, we're not going to spend a whole bunch of time on them because and this is actually another quote from weed of Andros. Um, a foolish consistency is the hobgoblin of little minds, which is to say that it is more important to write clear, readable code
06:57
that matches the style of whatever project you're on
07:00
than it is to match every single detail of the Python coding convention. It is more important than your could be easy to use and easy to understand then 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 on. Feel free to read them. You could see that on this light is a Lincoln and supplemental Materials will also include that link,
07:18
but they're not. They're not lost there.
07:20
Guidelines.
07:23
So a knowledge check.
07:24
What does Rebel stand for?
07:27
We'll give you just a couple of seconds
07:30
read. Execute print loop.
07:32
I don't but Luke there because I want to specify it is a read execute print and that is being done in a loop,
07:40
which Pep covers the Zen of Python
07:45
20
07:46
and which Pepe covers The Python conventions actually don't know that I said it out loud, but that is going to be pep eight. 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 heavy and read it. But it's much more importantly, you're right functional. Easy to redcoat.
08:03
That's all there is for lesson zero. When you come back to lesson one. We're going to discuss programming basics, logic. We're gonna really dig into some Boolean logic truth tables. We're gonna have a great time. Over the course of this lesson. A czar knowledge check suggested we learned about the history of Python. We learned about the fundamental workings of it. And, of course, we learned that it is much more important
08:22
to be easy to read than it is to be pretty.
08:26
Thank you all very much. I look forward to seeing you in the next video.

Up Next

Intro to Python

This is an introductory course on Python for cyber security, giving students the ability to understand the basics of the language, solve problems with scripts and identify useful Python modules.

Instructed By

Instructor Profile Image
Joe Perry
Senior Technical Instructor at FireEye, Inc
Instructor