Hey, you're still sticking around.
That's good, I didn't bore you with all my talking, but yes, in this video, finally, we're going
to write some python code.
Holy moly.
Thank God.
I thought that was going to last forever.
All right.
So what is our first program going to do?
Well, let's create a very, very simple function and probably the first thing any programmer learns
to do to print our own name.
So in here, once you have your Reppel got it set up or remember, you can also use glottal IO.
We're simply going to write, print.
And then you see over here that it gives us some information, but all we want to do is write Brackett's
a quote.
So you can do double quotes here or a single quote and just type your name.
And if we click, Ron.
On the right side, we've just ridden our very first Python program, very exciting, but what's happening
here?
Well, let's let's look at everything.
First of all, if you're confused why my thing is dark and yours might be light, it's because if I
go to settings, I've set my theme to light or to dark.
I prefer the dark version.
But you can change some of your settings.
You can change the font size if you want, based on when you watch the video, this website, the lock
might be different, but most of the settings should be the same.
We see that we have a main dot pi, which is the python extension, any file that has a dot pi or PI
is a python file.
So what we've just written here on line one is.
A program that prints in this case Andre Nagui or in your case, your own name, and we've run it to
this file now, Reppel, that it takes this file already has this interpreter.
For us, it runs this piece of code, gives this source code of may not apply to the interpreter and
runs it right here on our right side.
If you look over here, we're using Python version three point six point one.
And down below we see that we have Andre Nagui printed.
So this is our code running.
Remember this diagram, all we've done is we have our main DCPI where we wrote print Andre Nagui, we
gave it to the interpreter that the Reppel already provides for us.
That interpreter takes our code, converts it into bytecode.
And here, I'll say Andre Nagui, and then it runs it in the C Python VM, which was on the right side
that we saw, and it finally prints our name because it tells the machine, hey, we want that text
printed.
So that's what we're seeing here.
This is the C Python virtual machine essentially running this code and telling this machine, hey,
I want you to print this.
All right, but this is a very exciting I mean, let's let's make this program a little bit more dynamic
for our first program, we want to do something more impressive than just print name.
So I'm going to teach you another thing we can do in Python, and it's called input.
Now, in here, I can say input, and you see that report actually gives me some information saying
that I have this, you can just click here and this input over here.
Well, what can we do, this input is going to prompt a user, and if I hover over it, you can see
how it's giving me some information, but input simply gives us a way to capture information.
So let's say, what is your name?
And if I run this code.
We see that we have our Python code running and it's asking me what is my name with this cursor here
so I can actually type something here, I can say.
And if I hit enter, well, there you go, I've just.
Typed in my own name, nothing that exciting, right, but this is where code becomes interesting because
we can store this information on our computer.
So, again, these are things that we're going to go over in detail in our Basics Python section, but
just to write our first code, let's assign this to memory.
That is let's say that name equals whatever is the input of what is your name?
And then finally, we can just print.
So remember, the interpreter is going to take this first line.
It's going to ask, what is your name?
I'm going to type something, that type of information is going to get assigned to a name.
And then finally we print name.
Remember, an interpreter takes Line-by-line Convert's code to bytecode and then finally runs it.
So let's give this a try.
I'm going to click run.
All right, what's your name?
My name is Andre.
I typed in my name hit Enter, and then it printed out Andre.
So for the final feat, let's greet so we're going to say print.
Hello.
And then plus name.
Now, don't worry about the syntax, we're going to go over it, but all we're doing is saying hello
and then adding our name to the end of this.
So let's see what happens if I run this and say, what is your name?
My name is Andre and I hit Enter.
I get hello, Andre, but no spaces, so let's add a little space hit run again.
For the fourth time, my name is Andre and says, Hello, Andre.
There it is, our first Python program.
Now, it's not very exciting because it is our first program, we're just learning the steps here.
But I hope because we've covered some of these topics ahead of time, that this isn't just pure magic.
Right.
You understand that this is source code.
This is main DCPI that we give to an interpreter that runs our code line by line and then executes our
program in this case are what is your name program?
How cool is that?
This is just the beginning where we're going to get more and more advanced here, see if he can play
around with this, we don't know that much about Python yet, but I hope this gets you excited because,
well, there's a lot more coding coming along.
I'll see in the next one.
Bye bye.