Python for Absolute Beginners Transcripts
Chapter: Writing your first lines of code
Lecture: Practice time!
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
It's your turn. It's time to work on the practice exercises. You've seen a little tiny bit of Python code
0:07
and we're going to start writing more and more every chapter. I'm going to dive deeper into it as we go but now that you've seen a little bit of code
0:14
the really the best way to learn Python or any programming language, is to try it out yourself. You just have to go through the motions
0:23
you have to experiment with it and somehow working through it yourself just burns it into your brain unlike many other ways.
0:31
I mean, watching is good. That gets you started but you've got to finalize it with doing practice. So I've come up with some practice exercises
0:38
for you, for this course. Now, we're over here on the course page and the reason I'm here is we need to get to the Github Repository
0:45
and the easiest way to do it is to just click this link right here. So, here we are in the Github Repository if we scroll down a little bit
0:51
here's the code that we have written or will have written. We haven't actually finished very much code that we're saving yet
0:58
we've just typed it into the REPL, but we haven't there's no files to save. But the files we write are going to appear.
1:03
There's also these practice exercises so you can click here and practice or you can come down and click on practice exercises.
1:09
When we get here, it has the chapters of course you can just click on those or if you want, you can go through the little readme and click on Ch04.
1:16
And here we are at the practice exercises. You don't need to download anything to get started you just follow along and it'll tell you what to do.
1:25
Hey, the amount of code or typing that you have to do is very, very minimal. It's more about exploring the ideas.
1:30
It starts with an overview telling you about how practice exercises work. Look, this is for you. Do them. I think they'll be beneficial to you
1:39
but if you don't want to do them, skip it, it's fine. Or if you get stuck for a really long time, you know don't let it kill you.
1:45
Just go to the next one, it's fine. Now, before we get into the main exercises the things you actually have to do
1:52
I'm going to give you some core concepts. Now, we talked about the core concepts as a reference video but these are also the basic ideas
1:59
of important things that we covered both during this chapter, but also that I think you're going to need to use for, you know, solving these exercises
2:07
in this particular chapter. So, it defines what the REPL is it talks about variables and values it reminds you how that goes
2:14
it talks about what you have to do to use the built-in libraries with the import keyword how to get Input from Users, and
2:20
how to convert text to integers and floating point values. So you have those as your reference there you can read through that if you want.
2:28
Now, we finally at the bottom get to the exercises. It's your turn, woo-hoo! So here are five exercises that I'd like you to do
2:35
for this chapter before you move on to the next. At least attempt them, you don't have to complete them if you get stuck, but give it a shot.
2:42
So, try to run the Python REPL. It might sound super easy, but if your system's not set up this is going to uncover that, right?
2:49
We're going to make sure you can run the Python REPL and you have the right version. Talks about doing a little bit of math and working with variables
2:56
getting some input from a user and then also converting that. Hint-hint. And, finally, here's one that we didn't cover
3:02
it's kind of extra credit for you but there's a built-in library called datetime. And if you write this line of code it will return a Date Time object
3:11
which tells you the year, the date, the month the hour, minute, second of whatever it is right now. So this final, more challenging version
3:18
is to use those two pieces of information along with f-strings to print out what year it is right now. To have the program discover the year
3:28
and then tell you whatever year it is when you're doing it. And, finally, pick one of these that you've done up here that you think is interesting
3:34
and then visualize it over at www.Pythontutor.com This is the set of exercises I've put together for you. Give them a shot, I think it'll help you
3:41
get a solid foundation before we move on to the next topic.