📺 Develpreneur YouTube Episode

Video + transcript

Python Certification Training - Interpreter

2021-06-08 •Youtube

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
0.46

[Music]

26.16

well hello and welcome back

28

we are starting a new series of videos

31.119

we are actually going to walk through

34.32

uh take the steps essentially do some

36.32

examples to get to

38.239

a certified associate in python

40.559

programming

41.76

uh this is going to be based off of the

43.84

python institute off of their

46

tests and their syllabus

50

they do have one that's a

53.76

they've got an entry level that is

55.68

basically general programming concepts

58.079

things of that nature i think as we go

59.92

through this we're going to be far

61.039

enough along that we will be able to

62.48

include those

63.359

as well particularly if you've worked on

65.68

the

66.479

15 minutes of 15 minutes a day django

69.119

python stuff there's a lot of the pieces

71.76

in there you'd probably want to brush up

73.84

on them if you wanted to get to that

75.52

do that exam but there's nothing that it

78.72

appears

79.92

that we need to have any kind of a

82.24

prerequisite

83.759

so for example as it says here unless

86.72

they change anything entry level is not

88.08

a prerequisite for associates so we're

89.6

going to actually jump right to

91.119

working on the associate uh working

93.759

towards that and i think even if you're

95.439

pretty new uh if you've worked through

97.439

some of our other stuff you should be in

98.799

good shape to to follow along

101.2

now what i am going to assume is that

102.72

you've gone through the the python

104.64

installation

106.079

ideally you want to be at 3.9 and if you

109.28

do i believe it's a dash v

113.119

then you'll see what version you're on

115.36

uh 3.9 at this point is the latest

117.6

stable one out there

118.64

and makes a lot of sense and you

121.52

definitely want to be

122.399

3.6 or later there was a there are

125.2

enough changes in 3.5 to 3.6

128.16

and 3.5 i think is not supported in most

131.039

places i'm not sure where it's supported

132.48

anymore

133.44

so you want to be at least three six if

136.08

not

136.48

uh like i said 3.9 is going to be your

139.12

your best bet

140.239

because you do sometimes see stuff on

142

exams that is going to be

143.599

that covers the latest version that's

145.92

out there

147.2

we're going to be working somewhat

148.879

through the syllabus i'll have links to

150.879

this so if you go to pythoninstitute.org

152.959

you can see there are various

154

certifications and as you're digging

156.08

through if you look at the certified

157.28

associate you will be able to find a

158.64

syllabus

159.68

and see the things that we're going to

161.04

be talking about

163.2

i'm going to do my best to try to take

166.239

like bullet items and put those into the

169.12

notes for each of these videos so that

170.72

you'll be able to

172.08

uh walk your way through what's there

173.36

and i'm gonna try to use keywords where

174.72

possible

175.68

uh some of them may or may not be

178.4

totally easy to look at

180.56

but i'm also gonna try to go somewhat in

182.84

order um

184.64

but there's going to be a little a

186

little bit of bouncing around as well

188.4

but we're going to start today we're

190.08

going to look at really focusing on the

192

interpreter

192.879

interpreting in the interpreter and

195.28

we're just going to basically again do

196.56

about 15 to 20 minute

198.56

chunks and do the best we can to just

200.72

work our way through these things until

202.159

we get to the end

203.36

and then be able to go get certified as

206.239

a

206.959

python developer so jumping right

210.319

into the interpreter nice thing about

213.28

python

214

is that you can come right in once

215.28

you've installed it is if you just

217.44

use the python command let me blow this

219.76

up a little bit more

225.04

and actually let me do it this way i'm

226.64

going to make it a little easier

230.159

so if you jump in um if you type just

233.04

python

233.76

in my case python3 because that's i have

236

a older version of python so this takes

237.92

me to version

238.879

i can see what it is version 3.9 and

242.56

you're right in on a command line so i

244.4

can do and i can

245.68

do python right away so i could say

247.84

print

249.519

uh hello world and boom

253.28

i'm there uh if you see here i can do

256.4

help

257.44

type help it'll let me i can either do

259.28

help with uh to get interactive help or

261.68

on an object uh it may be worth it as

264.56

you're playing around

266.4

and essentially playing around if you

267.84

want to use the interpreter to help you

269.759

test out some things you're working on

271.44

in python

273.04

then if you jump into the interactive

275.44

version

276.16

you'll get a little help prompt and then

278.16

there's things like

279.919

you can do modules but you're going to

281.6

have to give it like a module name

284.16

because i think so if you just do

285.84

modules

287.52

there's probably not any available right

289.12

now yeah so there's nothing really

290.96

that's in there oh wait i guess there is

292.4

there's a whole bunch that have been

293.52

that are going to be in there by default

295.759

that i can see they're available and you

297.28

can

297.6

do help on any one of those

300.88

you can also see what you may find much

303.52

more useful

304.32

are the keywords you see some of the

307.44

keywords you can use

308.8

and so i could do like a help assert

314.479

oop i'm sorry i need to do it with

316.24

parentheses

320.96

oh there isn't anything on oh

324.8

well maybe it doesn't like that

328.56

okay so it's not doing anything good

330

there if i do well let's see if i do

332.4

help

332.88

string yeah so it's not very helpful

336.4

right now

337.28

but um

340.479

but more importantly you can see some of

342

the things that are out there

343.52

and let me see if i do like help uh if

347.199

and i forget if it's a string oh there's

349.919

not any

350.479

documentation so you you can see at

352.24

least some of the commands you can use

354.08

most of this is stuff we're going to

355.28

actually get into when we're

357.759

writing code and these are things that

360.639

we're going to we can come in

362

and do let me get out of this real quick

366.319

get back to uh let's see let me just get

368.4

out here

369.52

let me get totally out okay so back to

371.919

it

373.039

you can do some help but you're probably

374.96

better off to find

376.96

help across internet you can import

380.08

modules so if i import os

382.479

then now i have that available so now i

384.72

could do os

385.6

dot oh like i think it's login let's see

389.68

i can probably find that somewhere so if

392.88

i do or let's just do os dot name

395.039

so if i do os dot name oh i'm gonna have

397.6

to print it

398.24

oh well it just tells me what it is or i

400.08

can do print

402.479

os dot name and now so let's

405.52

but if i do os it's gonna tell me that

407.36

it's a module

409.599

if i do os dot login i think that's one

411.84

it'll tell me

413.68

it has no attribute if i do it with this

417.919

let's see what is it or is it user login

419.759

my mistake let's go

423.599

oh git login

426.8

so if i do get login so we see if i do

430.16

get login it's going to tell me that's

431.44

actually a function so if i do it with

433.36

a as a function then it's going to give

436.8

me the return

437.52

or and here in the um

440.56

interactive mode it's basically going to

442.08

kick out whatever the evaluation is

445.12

so here i'm actually printing it you can

446.56

see that it evaluated to this string

448.4

but here i'm printing it out so i could

451.12

do

451.919

let's say let a equals let's see a

454

equals three

455.44

b equals four c

458.8

equals five and i can do a plus b

463.28

well sorry a plus b

466.4

and see that it's it's evaluating that

468.8

for me uh here when it's doing

470.24

assignment it's not actually doing any

471.68

sort of evaluation

473.36

but also if i do so same thing if i do

475.44

print a

476.8

plus c then

480.08

it's essentially going to give me the

481.199

same thing

483.36

but it's it's a way for you to sort of

485.199

quickly get through stuff see how things

486.879

are evaluating as you go so i could do a

488.879

plus c so if i do

490.639

uh d equals

493.68

a plus b shoot

497.599

well it's still going to do that and

498.72

then i can do print d

502

and so i can also go back i can print a

505.52

and so it's actually building stuff up

507.199

here

508.639

um i could actually i can pull some

510.479

files and i can do

512.399

um various things and and really with

515.68

the command line it's mostly just

517.919

getting yourself moderately comfortable

519.76

to know how to do things like

522.08

uh importing uh some sort of module if

525.839

you need to

526.88

it's mostly for testing and as you go in

531.44

um let's see if you go into the syllabus

535.6

oh if i can click over here you see that

538.56

mostly it's just a basic concept so

540.88

we're really just going to get into the

542.08

idea and these things are going to

544.08

really flesh out later so this

545.76

at this point we're just going to jump

547.519

into you know we're just showing sort of

548.8

a highlight i think we've seen all of

550.16

this

551.04

when you look at compilation then um

554.88

let's see if i go to oh i don't have

558

anything available

559.6

i don't think i have any

563.44

i don't have a good python script

564.88

sitting here no

567.12

so what i'm going to do uh and we're

568.88

going to slide i'm actually use pycharm

571.2

uh just the free version for doing a lot

573.92

of my

574.64

scripting it's just a nice ide

580.24

and i'm waiting for that

592.27

[Music]

595.6

and let me go here so if i go to

600.18

[Music]

602

i think i've got some here

606.959

um

615.519

so i'm doing this let me grab a couple

617.6

little scripts here

619.92

let's see

625.519

let's do

628.88

there we go that's where it's at

632.56

so i'm going to come in here whoops

634.85

[Music]

639.36

so i've got a couple different little

640.72

scripts here so let's just look at this

643.12

app one and i'm going to look at that in

646.079

here right now

647.76

so this is a very simple hello world i'm

650.48

going to allow it to

651.839

send some arguments and then i'm going

654.56

to walk through and just print those

655.76

things out

656.88

now as far as compilers go it's going to

659.12

we don't have to specifically compile

661.2

anything

662

but it's going to create a pyc file

665.519

so all we have to do if i do python 3

669.76

app one now no

672.8

we did not create a pyc file

676.16

when we just run it uh where do we run

679.279

one somewhere in here when we just run

680.8

it

681.12

it's gonna just run through and it's

683.04

gonna not necessarily

684.24

show up uh we're not gonna get compiled

686.079

it's just gonna basically run through

687.76

the interpreter

689.12

and so if i get this uh let's call this

692.16

so just to do this real quick so if i do

694.56

this with hello world

696.56

then uh the arguments sent are gonna be

699.839

hello world there we go and of course

701.279

the name

703.279

if i want to compile then i'm going to

706

do

707.519

what i can do is i can do a compile oh

710.24

if i spell it right

712.24

compile all the same file

715.76

and now it compiles it and what we're

717.6

going to see here is i don't see a pyc

719.839

but i do see this py cache

722.24

and so if i look there

725.519

then i'm going to see where it compiled

728.16

to a pyc file that app won

732.32

so we can do that uh and have something

734.8

that's gonna be a little bit faster

736.72

uh really there's not it's there is

740.56

some more advanced stuff that we'll

741.76

probably talk about at some point where

743.2

we're going to get into

744.8

uh really difference between

746.48

interpreting compilation but because

748.56

python is so built to be interpreted

752.48

uh you know it's one of those things i

754.56

don't think you're going to see a whole

755.6

lot

755.92

other than just understand that there is

758.88

the concept of compilation

760.56

or interpreting these other things in

763.6

the first

764.079

bullet point we're talking about syntax

766.32

and semantics

767.68

python keywords instructions and

769.36

indenting we've really covered that to

771.44

some extent

772.079

in the past if i look

775.36

let me do this let me find

786.72

a place to put that let's just do this

792.959

so now if i put on all these ah let's do

795.68

my dirt

801.279

oops i'm going to do just a little bit

805.44

of house cleaning here so now i'm going

807.76

to come into

808.639

here okay so we have just our final bit

811.6

so we can see some things

813.519

now some basics that we want to cover

815.92

just real quickly as we're going through

817.76

our introduction note that as we've

820.959

probably

821.76

covered before is that there is an

823.44

indentation

826.839

uh

828.72

let me get rid of my notifications here

830.959

uh note that

832.399

as we've talked about in the past that

834.079

there is a

835.6

indentation that matters in

838.72

python we don't have uh end of lines

842.16

with a

842.88

semicolon or something like that is we

844.639

do an actual just line end

846.399

and then that's going to get us to our

847.519

next one and indentation is

850.399

critical when we're dealing with

854.16

anything in python also it's probably

857.519

good to note

858.48

now depending what you come from it is

860

case sensitive

861.519

so if i do

866.16

item equals blah

869.92

[Music]

871.76

and here

875.07

[Music]

878.72

i do this

882

then we're going to see something very

883.279

different so if i come over here

886.48

um i'm going to call that app one

894.24

let's see and i'm going to do one two

895.68

and three

898.24

oh where'd i do that oh that's if

900.399

there's a dash so i'm sorry so

903.92

dash one dash two dash three

907.92

so i have here i've got potentially

910

there's flags in here

912

and so we can see here in this little

914.16

thing that dash one it's going to say

915.519

there's a dash one but then we see here

918.399

flag value of dash one but this one is

921.44

going to pick up the blah so we see that

922.959

with each of those so we are

924.56

case sensitive and that is critical to

927.519

remember as we get into python

929.44

now we've been in it for a while so that

931.279

probably

932.56

is something that sort of second nature

933.92

to you uh also good to note

936

that we use parentheses fairly regularly

938.24

for our functions

939.199

however we don't in our ifs if you're

941.92

coming from

942.8

java or c that may

945.92

cause you some issues at times just

947.519

remember that functions we got to use

948.959

those

949.92

and in if statements and four blocks we

952.16

don't necessarily

953.199

have those so that can cause a little

955.6

bit of confusion

957.839

and that being said uh let's see let's

960.8

go back over here

962.56

so really what the keywords instructions

965.12

we've looked at that and sort of how

966.56

they work

967.199

how functions work we're going to get

968.56

deeper into those but i think that's

970.48

sort of our good

971.36

first um you know first start we're

973.759

going to come in next and we're going to

974.88

look at our literals

976.16

so that will wrap it up for today uh

978.72

we'll start digging in a little more

980.079

deeper i know it's going to be seems

982.16

simplistic initially

983.839

but i want to make sure we walk through

985.44

each of those and there may be some

986.639

things here and there that we

987.839

you know we cover that we haven't to

989.12

this point so

990.88

go out there have yourself a great day

992.56

and we will talk to you

994.16

next time

1010.88

you