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