 So our clock is kind of cool, but it's a little bit doofy that it keeps printing the time on a new line It would be cooler if it just kept updating the time in one place So we didn't get a string of times with the new line for every second It's kind of a something that we may not know how to do off the top of our head and so this is a great opportunity to introduce Stack overflow and in general internet searches as the key to coding Whenever I come across something I don't know how to do I go to a browser I go to our search engine and I type in how do I do XYZ and I get a bunch of results Often maybe Half the time that answer will be on a website called stack overflow that's a specific place where people can go and pose coding questions And then other people come and pose answers and then people can chime in and say I got that too But I tried this other thing differently and they vote them up and down and the most popular answer tends to be the best one And it's a great community resource for finding out how to do oddball random things like printing new lines without adding a new line each time So in this case I did a search and I came up with this page how to overwrite the previous print to standard out in Python So standard out is the console or whatever window you're working in to get to run your Python program and We don't want to print a new line. We want to overwrite the previous line that we printed So here is someone you can see they pose the question Hey, I ran this code and I got an output of one two three on different lines Instead of printing a new line I want to replace the previous value and overwrite it with a new value on the same line and Then we come down here and we see someone answered. There are a bunch of answers 16 This one has a green check mark Meaning that it was accepted by the person who answered the question as the best answer And it also has a hundred and thirty four upvotes meaning a lot of people saw it and said hey This is a good answer like this should be near the top simple version Use the carriage return Which is a quote backslash r character to return to the start of a line without advancing to the next line and It shows us here how it would do this We haven't talked about what four means yet, but this right here is the part we care about so print the thing that we're interested in comma and equals quote backslash r quote very cool We may not know yet exactly why this works or exactly what it's doing But now we have a solid lead on what to do to get what we want We can do a little more searching and fortunately Python is documented really well There is a list of all of the built-in functions available So these are all of the things that come with your core basic Python before you've imported any kind of libraries One of these is the print that we've been using So we can look and get some more detail on what's going on there and figure out why this stack overflow answer Gets us what it does so the official documentation for print here is Fairly brief fairly compact, but we'll go ahead and step through it So when we call print with parentheses after it the print function This shows us a few different arguments or things that we can pass to it You can think of functions like recipes and The arguments are like ingredients They're the flour and the sugar and the eggs and the milk that you provide and then the function takes them Mixes all up and bake some at 350 for 20 minutes and gets you a cake so this list of arguments is a list of ingredients in Print this objects with an asterisk before it It says you can give it just a list of anything to be printed So we've printed floating point numbers. We've printed strings, but we can pass it anything we want And it'll try to turn it into a string and print it Then there's a comma then it says here are some other Ingredients here are some other arguments that you can provide if you want But if you don't I will provide them for you and here's what I'll give you So for instance We can provide a sep to print if we don't Sep will be a see this quote space quote. It'll be the space character What this means is that if we give it several objects for instance if we say print variable one comma variable two comma variable three And then we say sep equals space. It'll put a space between each of those But we could make that be anything you want. We can make it be a comma We can make it be a backslash. We can make it be a smiley face We can use anything any kind of separator we want there, but if we don't it will go ahead and default To a space which is a great separator, so we probably don't need to worry about that So here we see the default End character at the end of each thing we print is a backslash end That's what we're seeing when we print the time and then it ends with the new line And so the next time we print it starts at the beginning of the next line That's the behavior that we don't want now the The answer that we found in stock overflow says instead of taking the default backslash end use end equals backslash R The carriage return character which takes it back to the beginning of the line, but the same line It doesn't take it down to the next line So whatever it prints next it'll write over Over whatever it was that we printed before it'll cut copy right over the top of it This makes sense now why that solution backslash R does what we want it to do and this explains a little bit better What's what's going on there? this arrangement of having arguments to a function have first the arguments without defaults then the arguments with defaults and those are called keyword arguments because you can Say give me end equals backslash R and end is the keyword So you can call those out individually and you can provide one or none or all of them and in any order You don't have to worry about it. The ones without defaults You have to provide in the order that they're provided. So they're also called positional arguments So in our case, we will provide our positional argument Which is our string that describes the time hour minute seconds and then we'll provide a keyword argument end equals backslash R So single quote backslash R single quote We are free to use single quotes or double quotes. They both Tell Python that this is a string. You can use them interchangeably Make sure however not to use your back tick Which is right under the tilde usually in the upper left corner of your keyboard That's different than a single quote the single quotes the one right underneath the double quotes right next to the enter key So single or double quotes around our character backslash R another tidbit here is Backslash R is not actually what gets printed The backslash says hey, I'm gonna print a thing here. That's not actually a character In this case, it's the carriage return. We also saw the backslash n which means new line These are called escape characters. There are things that don't look like characters on the string on the screen But they tell the print function to do something a little bit different So a lot of details coming together to make this one seemingly simple thing happen That's okay. That's normal And it's also normal if you feel like there's a lot of balls in the air a lot of loose ends coming together to make this happen Step back and walk through it as many times as you need to until it sits well until you see the pieces come together But the important lesson to take away from this that will bless you your entire Programming career is don't hesitate to internet search for it and go to stack overflow It's not right a hundred percent of the time or helpful a hundred percent of the time, but it is an excellent resource Now when we run this we see that exactly as we hoped Each time after it prints it sleeps for a second It jumps back to the beginning of the line before it prints the next one instead of jumping to a new line below This now gives us a pretty little clock. Well, tell us what time it is. Tell us if it's five o'clock somewhere