 To start off with, we're going to build a clock. It's really convenient to be able to see what time it is. Pull up the file, clock underscore zero zero dot pi, and then pull up a way to execute that file. I'm using the command line here. In the file, clock underscore zero zero, we have just four lines of code, one of them's blank. So just three lines of actual code. I've numbered the files with two-digit numbers starting at zero. Everything in Python counts, not starting from one, but starting from zero. Different languages handle it different ways. All you have to know is that for Python, it does start from zero, and keeping that in mind, we'll see lots of instances where that helps. In our clock underscore zero zero file, the very first line says import time. What this does is it takes the Python library, the Python package called time, and it pulls it in so that all of the functions and the variables and the information that it has are now available to us to use in our program. Time is a package, it's a library. The way Python is set up, there's a small amount of functions, operations, things that you can do that is the Python core, the basic building blocks of the language, and then people have taken those and built other interesting parts on top of them, other packages that aren't absolutely essential to the core of the language, but that are very useful depending on what we're doing. And so it's very common at the beginning of your Python script to import a package or two or ten so that you have all the tools that you need. Because we're going to be working with time and with clocks, we'll import this package, time, that's very useful. Every single one of the official packages, officially maintained packages, you can get documentation for at the python.org website. So here, for instance, we'll go and look up the time library, the time package, and see some information about it. We can read about what it provides. There's a helpful list of definitions that we'll come back to a little later. And we can see all of the functions that it provides. So these are things that it can do for you. And there's also constants that it gets you access to. So these are numbers or values or settings that you can read from it. So this combination of both things that it can do for you and pieces of information that it has, these will be a recurring theme. Functions and values, functions and constants we'll be able to pull from it. These documentation pages are immensely useful and I find myself referring to them all the time when I'm using a package that I'm not familiar with. I don't remember almost any detail of how to implement any of these functions. I look them up and that's great. Then I get the official refresh on my memory each time and I know how to do it correctly. The very first function that we'll use is the time function. So this is a little bit confusing because the package is called time, but it also has a function called time. And the syntax for that is time dot time parentheses. When the Python interpreter sees this, when the program that looks through this text file and decides what to do, reads this, what it sees is, okay, I have the time before the period that refers to the package, then after the period is something that is a part of that package. So in this case, it's the time function. We know it's a function because of the parentheses after it. When you see something with parentheses after it like this, it's a function, you can think of it as a verb. It's a procedure, it's a recipe, it's something that the computer is being asked to do. In this case, the time function returns a bit of information about the current time. And we can learn exactly what that is by going to the documentation. We see that it returns a float, which is a floating point decimal number. So it can be a large number period with a lot of decimals that come after, as opposed to say an integer, which is just a whole round number like zero, one, two, three, minus one, minus two, minus three, et cetera. We learn that this function returns, so when you run it, what you get when you're done is the time in seconds since the epic as a floating point number, a number that can have something after the decimal point. So in this case, it goes on to explain that this epic is a special thing. Computers don't handle time in a way that's intuitive to you and me because they work differently and they have to be able to compare times with each other very quickly all over the world. And so there's this agreed upon standard, which is, well, let's start counting seconds. At January 1st, 1970, before then there weren't too many computers to worry about, so it's kind of a nice beginning of time for computers. And the number of seconds since then is the time that we're talking about. So the epic is that time period, January 1st, 1970 at midnight. And then the time since then is the Unix time or the Unix epic time. So when we run this function, time dot time, what we get back is a count of seconds for a time that's over 50 years old, so this number is gonna be big. The way we get that answer out is we create a variable, which we will name right now, right underscore now, and we'll say that equals time dot time. So we run the time function of the time package and the result of that gets put into this variable, gets assigned to this variable right now. Then we're curious, we wanna see what time it is. We can print right now. We can print whatever the value of that variable is, whatever the floating point number that has been tucked in to that cubby hole that that variable is the name tag on, that's what we can see. And the print function does what you might expect. It takes whatever that number or set of letters or object is that you send it and it turns it into something that you can see in the command line or in wherever you're executing this. So in this case, it'll take that number and it'll turn it into a bunch of digits and show it to us on the console. And when I run it on my machine, I get an answer that looks like this. One, six, zero, number, number, number, period, number, number, number, number. So this is the number of seconds down to what it looks like the sub millisecond level since January 1st, 1970. So to my computer, this is the time. When I look at that, it looks like gobbledygook. So it's not very much used as a clock, but it's a really important first step toward getting the time. We can run it again and the two numbers are very similar, but we can see if we count down and get close to the decimal place, we can see there is a small difference between them. Because we ran the second time a few seconds after the first time, and in this case, we can see exactly how many seconds that was. So the difference between these is a kind of a timer between the two times that we ran the program. This is a good start on the clock.