Detailed Notes
We start the series focused on certification with a look at the interpreter.
Learn more about the overall certification and syllabus here: https://pythoninstitute.org/certification/pcap-certification-associate/pcap-exam-syllabus/
Transcript Text
[Music] well hello and welcome back we are starting a new series of videos we are actually going to walk through uh take the steps essentially do some examples to get to a certified associate in python programming uh this is going to be based off of the python institute off of their tests and their syllabus they do have one that's a they've got an entry level that is basically general programming concepts things of that nature i think as we go through this we're going to be far enough along that we will be able to include those as well particularly if you've worked on the 15 minutes of 15 minutes a day django python stuff there's a lot of the pieces in there you'd probably want to brush up on them if you wanted to get to that do that exam but there's nothing that it appears that we need to have any kind of a prerequisite so for example as it says here unless they change anything entry level is not a prerequisite for associates so we're going to actually jump right to working on the associate uh working towards that and i think even if you're pretty new uh if you've worked through some of our other stuff you should be in good shape to to follow along now what i am going to assume is that you've gone through the the python installation ideally you want to be at 3.9 and if you do i believe it's a dash v then you'll see what version you're on uh 3.9 at this point is the latest stable one out there and makes a lot of sense and you definitely want to be 3.6 or later there was a there are enough changes in 3.5 to 3.6 and 3.5 i think is not supported in most places i'm not sure where it's supported anymore so you want to be at least three six if not uh like i said 3.9 is going to be your your best bet because you do sometimes see stuff on exams that is going to be that covers the latest version that's out there we're going to be working somewhat through the syllabus i'll have links to this so if you go to pythoninstitute.org you can see there are various certifications and as you're digging through if you look at the certified associate you will be able to find a syllabus and see the things that we're going to be talking about i'm going to do my best to try to take like bullet items and put those into the notes for each of these videos so that you'll be able to uh walk your way through what's there and i'm gonna try to use keywords where possible uh some of them may or may not be totally easy to look at but i'm also gonna try to go somewhat in order um but there's going to be a little a little bit of bouncing around as well but we're going to start today we're going to look at really focusing on the interpreter interpreting in the interpreter and we're just going to basically again do about 15 to 20 minute chunks and do the best we can to just work our way through these things until we get to the end and then be able to go get certified as a python developer so jumping right into the interpreter nice thing about python is that you can come right in once you've installed it is if you just use the python command let me blow this up a little bit more and actually let me do it this way i'm going to make it a little easier so if you jump in um if you type just python in my case python3 because that's i have a older version of python so this takes me to version i can see what it is version 3.9 and you're right in on a command line so i can do and i can do python right away so i could say print uh hello world and boom i'm there uh if you see here i can do help type help it'll let me i can either do help with uh to get interactive help or on an object uh it may be worth it as you're playing around and essentially playing around if you want to use the interpreter to help you test out some things you're working on in python then if you jump into the interactive version you'll get a little help prompt and then there's things like you can do modules but you're going to have to give it like a module name because i think so if you just do modules there's probably not any available right now yeah so there's nothing really that's in there oh wait i guess there is there's a whole bunch that have been that are going to be in there by default that i can see they're available and you can do help on any one of those you can also see what you may find much more useful are the keywords you see some of the keywords you can use and so i could do like a help assert oop i'm sorry i need to do it with parentheses oh there isn't anything on oh well maybe it doesn't like that okay so it's not doing anything good there if i do well let's see if i do help string yeah so it's not very helpful right now but um but more importantly you can see some of the things that are out there and let me see if i do like help uh if and i forget if it's a string oh there's not any documentation so you you can see at least some of the commands you can use most of this is stuff we're going to actually get into when we're writing code and these are things that we're going to we can come in and do let me get out of this real quick get back to uh let's see let me just get out here let me get totally out okay so back to it you can do some help but you're probably better off to find help across internet you can import modules so if i import os then now i have that available so now i could do os dot oh like i think it's login let's see i can probably find that somewhere so if i do or let's just do os dot name so if i do os dot name oh i'm gonna have to print it oh well it just tells me what it is or i can do print os dot name and now so let's but if i do os it's gonna tell me that it's a module if i do os dot login i think that's one it'll tell me it has no attribute if i do it with this let's see what is it or is it user login my mistake let's go oh git login so if i do get login so we see if i do get login it's going to tell me that's actually a function so if i do it with a as a function then it's going to give me the return or and here in the um interactive mode it's basically going to kick out whatever the evaluation is so here i'm actually printing it you can see that it evaluated to this string but here i'm printing it out so i could do let's say let a equals let's see a equals three b equals four c equals five and i can do a plus b well sorry a plus b and see that it's it's evaluating that for me uh here when it's doing assignment it's not actually doing any sort of evaluation but also if i do so same thing if i do print a plus c then it's essentially going to give me the same thing but it's it's a way for you to sort of quickly get through stuff see how things are evaluating as you go so i could do a plus c so if i do uh d equals a plus b shoot well it's still going to do that and then i can do print d and so i can also go back i can print a and so it's actually building stuff up here um i could actually i can pull some files and i can do um various things and and really with the command line it's mostly just getting yourself moderately comfortable to know how to do things like uh importing uh some sort of module if you need to it's mostly for testing and as you go in um let's see if you go into the syllabus oh if i can click over here you see that mostly it's just a basic concept so we're really just going to get into the idea and these things are going to really flesh out later so this at this point we're just going to jump into you know we're just showing sort of a highlight i think we've seen all of this when you look at compilation then um let's see if i go to oh i don't have anything available i don't think i have any i don't have a good python script sitting here no so what i'm going to do uh and we're going to slide i'm actually use pycharm uh just the free version for doing a lot of my scripting it's just a nice ide and i'm waiting for that [Music] and let me go here so if i go to [Music] i think i've got some here um so i'm doing this let me grab a couple little scripts here let's see let's do there we go that's where it's at so i'm going to come in here whoops [Music] so i've got a couple different little scripts here so let's just look at this app one and i'm going to look at that in here right now so this is a very simple hello world i'm going to allow it to send some arguments and then i'm going to walk through and just print those things out now as far as compilers go it's going to we don't have to specifically compile anything but it's going to create a pyc file so all we have to do if i do python 3 app one now no we did not create a pyc file when we just run it uh where do we run one somewhere in here when we just run it it's gonna just run through and it's gonna not necessarily show up uh we're not gonna get compiled it's just gonna basically run through the interpreter and so if i get this uh let's call this so just to do this real quick so if i do this with hello world then uh the arguments sent are gonna be hello world there we go and of course the name if i want to compile then i'm going to do what i can do is i can do a compile oh if i spell it right compile all the same file and now it compiles it and what we're going to see here is i don't see a pyc but i do see this py cache and so if i look there then i'm going to see where it compiled to a pyc file that app won so we can do that uh and have something that's gonna be a little bit faster uh really there's not it's there is some more advanced stuff that we'll probably talk about at some point where we're going to get into uh really difference between interpreting compilation but because python is so built to be interpreted uh you know it's one of those things i don't think you're going to see a whole lot other than just understand that there is the concept of compilation or interpreting these other things in the first bullet point we're talking about syntax and semantics python keywords instructions and indenting we've really covered that to some extent in the past if i look let me do this let me find a place to put that let's just do this so now if i put on all these ah let's do my dirt oops i'm going to do just a little bit of house cleaning here so now i'm going to come into here okay so we have just our final bit so we can see some things now some basics that we want to cover just real quickly as we're going through our introduction note that as we've probably covered before is that there is an indentation uh let me get rid of my notifications here uh note that as we've talked about in the past that there is a indentation that matters in python we don't have uh end of lines with a semicolon or something like that is we do an actual just line end and then that's going to get us to our next one and indentation is critical when we're dealing with anything in python also it's probably good to note now depending what you come from it is case sensitive so if i do item equals blah [Music] and here [Music] i do this then we're going to see something very different so if i come over here um i'm going to call that app one let's see and i'm going to do one two and three oh where'd i do that oh that's if there's a dash so i'm sorry so dash one dash two dash three so i have here i've got potentially there's flags in here and so we can see here in this little thing that dash one it's going to say there's a dash one but then we see here flag value of dash one but this one is going to pick up the blah so we see that with each of those so we are case sensitive and that is critical to remember as we get into python now we've been in it for a while so that probably is something that sort of second nature to you uh also good to note that we use parentheses fairly regularly for our functions however we don't in our ifs if you're coming from java or c that may cause you some issues at times just remember that functions we got to use those and in if statements and four blocks we don't necessarily have those so that can cause a little bit of confusion and that being said uh let's see let's go back over here so really what the keywords instructions we've looked at that and sort of how they work how functions work we're going to get deeper into those but i think that's sort of our good first um you know first start we're going to come in next and we're going to look at our literals so that will wrap it up for today uh we'll start digging in a little more deeper i know it's going to be seems simplistic initially but i want to make sure we walk through each of those and there may be some things here and there that we you know we cover that we haven't to this point so go out there have yourself a great day and we will talk to you next time you
Transcript Segments
[Music]
well hello and welcome back
we are starting a new series of videos
we are actually going to walk through
uh take the steps essentially do some
examples to get to
a certified associate in python
programming
uh this is going to be based off of the
python institute off of their
tests and their syllabus
they do have one that's a
they've got an entry level that is
basically general programming concepts
things of that nature i think as we go
through this we're going to be far
enough along that we will be able to
include those
as well particularly if you've worked on
the
15 minutes of 15 minutes a day django
python stuff there's a lot of the pieces
in there you'd probably want to brush up
on them if you wanted to get to that
do that exam but there's nothing that it
appears
that we need to have any kind of a
prerequisite
so for example as it says here unless
they change anything entry level is not
a prerequisite for associates so we're
going to actually jump right to
working on the associate uh working
towards that and i think even if you're
pretty new uh if you've worked through
some of our other stuff you should be in
good shape to to follow along
now what i am going to assume is that
you've gone through the the python
installation
ideally you want to be at 3.9 and if you
do i believe it's a dash v
then you'll see what version you're on
uh 3.9 at this point is the latest
stable one out there
and makes a lot of sense and you
definitely want to be
3.6 or later there was a there are
enough changes in 3.5 to 3.6
and 3.5 i think is not supported in most
places i'm not sure where it's supported
anymore
so you want to be at least three six if
not
uh like i said 3.9 is going to be your
your best bet
because you do sometimes see stuff on
exams that is going to be
that covers the latest version that's
out there
we're going to be working somewhat
through the syllabus i'll have links to
this so if you go to pythoninstitute.org
you can see there are various
certifications and as you're digging
through if you look at the certified
associate you will be able to find a
syllabus
and see the things that we're going to
be talking about
i'm going to do my best to try to take
like bullet items and put those into the
notes for each of these videos so that
you'll be able to
uh walk your way through what's there
and i'm gonna try to use keywords where
possible
uh some of them may or may not be
totally easy to look at
but i'm also gonna try to go somewhat in
order um
but there's going to be a little a
little bit of bouncing around as well
but we're going to start today we're
going to look at really focusing on the
interpreter
interpreting in the interpreter and
we're just going to basically again do
about 15 to 20 minute
chunks and do the best we can to just
work our way through these things until
we get to the end
and then be able to go get certified as
a
python developer so jumping right
into the interpreter nice thing about
python
is that you can come right in once
you've installed it is if you just
use the python command let me blow this
up a little bit more
and actually let me do it this way i'm
going to make it a little easier
so if you jump in um if you type just
python
in my case python3 because that's i have
a older version of python so this takes
me to version
i can see what it is version 3.9 and
you're right in on a command line so i
can do and i can
do python right away so i could say
uh hello world and boom
i'm there uh if you see here i can do
help
type help it'll let me i can either do
help with uh to get interactive help or
on an object uh it may be worth it as
you're playing around
and essentially playing around if you
want to use the interpreter to help you
test out some things you're working on
in python
then if you jump into the interactive
version
you'll get a little help prompt and then
there's things like
you can do modules but you're going to
have to give it like a module name
because i think so if you just do
modules
there's probably not any available right
now yeah so there's nothing really
that's in there oh wait i guess there is
there's a whole bunch that have been
that are going to be in there by default
that i can see they're available and you
can
do help on any one of those
you can also see what you may find much
more useful
are the keywords you see some of the
keywords you can use
and so i could do like a help assert
oop i'm sorry i need to do it with
parentheses
oh there isn't anything on oh
well maybe it doesn't like that
okay so it's not doing anything good
there if i do well let's see if i do
help
string yeah so it's not very helpful
right now
but um
but more importantly you can see some of
the things that are out there
and let me see if i do like help uh if
and i forget if it's a string oh there's
not any
documentation so you you can see at
least some of the commands you can use
most of this is stuff we're going to
actually get into when we're
writing code and these are things that
we're going to we can come in
and do let me get out of this real quick
get back to uh let's see let me just get
out here
let me get totally out okay so back to
it
you can do some help but you're probably
better off to find
help across internet you can import
modules so if i import os
then now i have that available so now i
could do os
dot oh like i think it's login let's see
i can probably find that somewhere so if
i do or let's just do os dot name
so if i do os dot name oh i'm gonna have
to print it
oh well it just tells me what it is or i
can do print
os dot name and now so let's
but if i do os it's gonna tell me that
it's a module
if i do os dot login i think that's one
it'll tell me
it has no attribute if i do it with this
let's see what is it or is it user login
my mistake let's go
oh git login
so if i do get login so we see if i do
get login it's going to tell me that's
actually a function so if i do it with
a as a function then it's going to give
me the return
or and here in the um
interactive mode it's basically going to
kick out whatever the evaluation is
so here i'm actually printing it you can
see that it evaluated to this string
but here i'm printing it out so i could
do
let's say let a equals let's see a
equals three
b equals four c
equals five and i can do a plus b
well sorry a plus b
and see that it's it's evaluating that
for me uh here when it's doing
assignment it's not actually doing any
sort of evaluation
but also if i do so same thing if i do
print a
plus c then
it's essentially going to give me the
same thing
but it's it's a way for you to sort of
quickly get through stuff see how things
are evaluating as you go so i could do a
plus c so if i do
uh d equals
a plus b shoot
well it's still going to do that and
then i can do print d
and so i can also go back i can print a
and so it's actually building stuff up
here
um i could actually i can pull some
files and i can do
um various things and and really with
the command line it's mostly just
getting yourself moderately comfortable
to know how to do things like
uh importing uh some sort of module if
you need to
it's mostly for testing and as you go in
um let's see if you go into the syllabus
oh if i can click over here you see that
mostly it's just a basic concept so
we're really just going to get into the
idea and these things are going to
really flesh out later so this
at this point we're just going to jump
into you know we're just showing sort of
a highlight i think we've seen all of
this
when you look at compilation then um
let's see if i go to oh i don't have
anything available
i don't think i have any
i don't have a good python script
sitting here no
so what i'm going to do uh and we're
going to slide i'm actually use pycharm
uh just the free version for doing a lot
of my
scripting it's just a nice ide
and i'm waiting for that
[Music]
and let me go here so if i go to
[Music]
i think i've got some here
um
so i'm doing this let me grab a couple
little scripts here
let's see
let's do
there we go that's where it's at
so i'm going to come in here whoops
[Music]
so i've got a couple different little
scripts here so let's just look at this
app one and i'm going to look at that in
here right now
so this is a very simple hello world i'm
going to allow it to
send some arguments and then i'm going
to walk through and just print those
things out
now as far as compilers go it's going to
we don't have to specifically compile
anything
but it's going to create a pyc file
so all we have to do if i do python 3
app one now no
we did not create a pyc file
when we just run it uh where do we run
one somewhere in here when we just run
it
it's gonna just run through and it's
gonna not necessarily
show up uh we're not gonna get compiled
it's just gonna basically run through
the interpreter
and so if i get this uh let's call this
so just to do this real quick so if i do
this with hello world
then uh the arguments sent are gonna be
hello world there we go and of course
the name
if i want to compile then i'm going to
do
what i can do is i can do a compile oh
if i spell it right
compile all the same file
and now it compiles it and what we're
going to see here is i don't see a pyc
but i do see this py cache
and so if i look there
then i'm going to see where it compiled
to a pyc file that app won
so we can do that uh and have something
that's gonna be a little bit faster
uh really there's not it's there is
some more advanced stuff that we'll
probably talk about at some point where
we're going to get into
uh really difference between
interpreting compilation but because
python is so built to be interpreted
uh you know it's one of those things i
don't think you're going to see a whole
lot
other than just understand that there is
the concept of compilation
or interpreting these other things in
the first
bullet point we're talking about syntax
and semantics
python keywords instructions and
indenting we've really covered that to
some extent
in the past if i look
let me do this let me find
a place to put that let's just do this
so now if i put on all these ah let's do
my dirt
oops i'm going to do just a little bit
of house cleaning here so now i'm going
to come into
here okay so we have just our final bit
so we can see some things
now some basics that we want to cover
just real quickly as we're going through
our introduction note that as we've
probably
covered before is that there is an
indentation
uh
let me get rid of my notifications here
uh note that
as we've talked about in the past that
there is a
indentation that matters in
python we don't have uh end of lines
with a
semicolon or something like that is we
do an actual just line end
and then that's going to get us to our
next one and indentation is
critical when we're dealing with
anything in python also it's probably
good to note
now depending what you come from it is
case sensitive
so if i do
item equals blah
[Music]
and here
[Music]
i do this
then we're going to see something very
different so if i come over here
um i'm going to call that app one
let's see and i'm going to do one two
and three
oh where'd i do that oh that's if
there's a dash so i'm sorry so
dash one dash two dash three
so i have here i've got potentially
there's flags in here
and so we can see here in this little
thing that dash one it's going to say
there's a dash one but then we see here
flag value of dash one but this one is
going to pick up the blah so we see that
with each of those so we are
case sensitive and that is critical to
remember as we get into python
now we've been in it for a while so that
probably
is something that sort of second nature
to you uh also good to note
that we use parentheses fairly regularly
for our functions
however we don't in our ifs if you're
coming from
java or c that may
cause you some issues at times just
remember that functions we got to use
those
and in if statements and four blocks we
don't necessarily
have those so that can cause a little
bit of confusion
and that being said uh let's see let's
go back over here
so really what the keywords instructions
we've looked at that and sort of how
they work
how functions work we're going to get
deeper into those but i think that's
sort of our good
first um you know first start we're
going to come in next and we're going to
look at our literals
so that will wrap it up for today uh
we'll start digging in a little more
deeper i know it's going to be seems
simplistic initially
but i want to make sure we walk through
each of those and there may be some
things here and there that we
you know we cover that we haven't to
this point so
go out there have yourself a great day
and we will talk to you
next time
you