[Music]
let's pop in next time don't leave it
that murder but come on in come on in
alright so today we're gonna do
something pretty fun welcome to my place
again and yeah today I'm not the star of
the show the star of the show today is
match oh my silver fog refer so I'm
gonna be teaching him how to program so
you guys ready it's gonna be pretty
basic cuz how much how much do you know
nothing are you sure yeah nothing at all
nothing but you want to get to Stanford
right yeah yes right let's do it alright
30 minute session be honest let me
record for 30 minutes let's start no I'm
gonna I'm gonna read my notes but for 10
you don't see my notes yeah I'm good
yeah so I guess okay first question how
much programming do you know or do you
even know what is programming
programming is what makes phones yeah oh
wait you can't tell me about yourself a
little bit okay how old you are
oh my sixteen I could good yeah well
idea of Tim and then now I'm making the
using yeah that's about it so yeah Matt
is Indian 16 and he's probably the best
cinematographer know which is great
because when you're 16 you're pretty
cheap so [ __ ] expensive yeah I keep
doesn't pay anything yeah I just don't
pay anything cuz it because he's because
he's a he's a fanboy but I see the
investment potential potential potential
but yeah it's okay cuz I'm gonna sell
video courses soon so maybe making money
better buy them so that is I could pay
you alright
the reason why I'm doing this is because
I want you to get into Stanford yeah so
you could be closer to where I live so
we can make more
yeah I don't care if you have like a
successful career or not so I guess one
thing that I want to talk about is that
when people think about programming
coding they think about just making
websites and stuff like that you know
it's because um because whenever I hear
about coding they always say like oh the
first thing you learn should be HTML and
CSS it's like yes but first of all those
aren't even coding languages did you
know that no no actually oh you knew
that okay okay so you know your [ __ ] so
yeah so usually think about that but
it's actually not even coating the
coating is basically the art of
automation the whole point of coding is
to what did I say delegate tasks a
machine rather than doing it yourself so
they can do it automatically what else
am i right and how do you the telogen to
do things you give them very very
precise instructions and those
instructions is basically your code all
right so are you ready to learn some
fundamentals yeah okay first function we
learn that is already made like you're
not gonna write this function it's
called print okay
for example drum is dope okay
and then what happens when you run this
you get Yeomans though right so this
thing in between print is a string
meaning its words or like characters and
you could also put numbers and then this
function is smart enough to print
different things you know okay cool so
try it yourself try to print like hi my
name is Matt chill yeah so that's
clearly wrong I said Matt oh that's
wonderful
okay you get the point so let's learn
about functions so let me tell you what
functions does so this is the syntax for
functions like this is how you write def
means you start a function you could
write any name like so I write dog these
parentheses I'll talk about later but
I'll just add them now and then I could
print don't go
right and then if I run this what
happens is that it runs the whole file
so now if I run the file it means this
has been recorded the function has been
recorded so if I run it it says dogle so
let's do something funky what do you
think would happen if I print and then I
put dog there what do you think that
will happen it's gonna print this whole
thing like I'll go what do you mean what
ii is just gonna print dog oh it's
actually gonna print nothing oh wait
alright is it okay dog oh sorry my bad
but okay so the reason why dog got
printed is because we called this
function but then why is there none like
for example if I do dog it prints toggle
but then if I do print dog it does
nothing the reason is because this
function returns nothing basically this
is what what what's really happening is
returning nothing but you can return
like for example for you know print
print is actually nothing related to
what you're gonna output in terms of
your function this is just like a side
effect right so imagine if you do oh
wait I gotta run it and then okay so
print dog so what do you think will
happen if I do this they're gonna print
taco and for let's try yes it is okay
cool so basically it returns you can
return stuff you can also remove you to
return it means like to imagine like to
after your press that function it passes
on a value so that another function can
use it or something else okay yeah so
how do you use these things that you
pass on good question you didn't ask me
but good question here's what we call
parameters right so in your spongebob we
could add parameters so what parameters
are our variable is kind of but on
functions like for example you could say
parameter let's just do something easy
like like hello just to show you that
you know so what happens is let's add
hello let's see what happens we got then
it's fun
now you can add stuff into it like let's
just add a random number five what do
you think it's gonna print it is it
gonna add five to the end of hi my name
is spongebob
yes that's right you also have to know
the operator comparison operators which
is like for example that's why so 4
equals big distinction there's a
distinction between like the one equal
sign and two equal sign mm-hmm one equal
sign is when you want to assign
something to something to equal sign is
you're comparing like is 4 equals 4
yeah so what do you think will happen if
I do some ideas yeah it will return true
yes okay what if I do
5 what do you think is happening the
return pulse yes okay what if I do MS
more lights - what if I do this what do
you think those will be false not true
you do math so I asked them to write a
simple function that requires if
statements and operators let me do some
squats Fitness channel Fitness channel
[Music]
mmm it is negative one that's good
stop let's do Wow Wow good job good job
I mean whisper to my channel alright
guys so I'm actually trying to teach him
recursion without him knowing it's
recursion so let's see if he if he gets
it right I'd say probably not but we'll
see
[Music]
Joma I'm done yeah did you can't do that
man
it works up to annex yes yes technically
it does work yes but I mean what if you
want to do seven right oops
so yeah yeah it doesn't even return
anything be alright okay it's okay
um it's okay I didn't expect you to to
get it because you know it's you really
had to think outside box and stuff like
that but no worries this is very
creative
I actually like this so basically what I
want to teach you it's recursion so it
means you could call the function within
the function as in you're gonna call
yourself alright so I'm not gonna teach
you all this because we're actually
running out of time so we're gonna end
it here but I'm just gonna show you real
quick what the code looks like alright
so it equals zero turn so basically what
I did here is I did the two initial
number for 0 and 1 and then else what
you want to do is you want to add the
previous one and the previous previous
one right so all you do it is and that's
1 minus 2 and then that's it
very simple alright and then if you do
56 interesting
I forgot the furniture
and if you put 56 it gives you 13 7 21
there you go there you have it alright I
hope that you enjoyed this small
tutorial that would cramp them into 30
minutes but yeah you did well I mean we
learn a lot of things we learn functions
we learn variables parameters and you
know conditions so this is pretty good
hopefully next time you'll be able to
make a web app on your own yeah next
tutorial yeah but yeah so in case you
don't know I'm gonna maybe start doing
some Python courses that will sell I
don't know how much yet I still have to
refine it and yeah I'm really excited
because I think finally it's gonna be
something very very useful for you guys
and also it can help me pay him
intensive yes because he's quite
expensive and I need to start paying
this guy to make my videos for me
alright cool so hope you like this video
if you liked it don't forget to like and
subscribe and also press the bell but
for notification and also it's Matt Cho
so don't forget to follow his channel
somewhere yeah don't do that no I
usually just black the screen I'm here
right so usually it just goes like
[Music]