In this video you learned how to take text data or strings and display them alongside the numerical calculations that you can now do using floats and ints. To do this, you use something in Python called f-strings, which stands for formatted strings, which is something that I and many other developers use all the time, especially with working with AI tools. Let's dive in. To recap, you see that strings represent or store text and integers and floats represent numbers, and you can display data with print commands. And you can also use Python as a calculator like this. So, we saw that if you were to convert 75 degrees from Fahrenheit to Celsius, you could do this. But what if you wanted to print the temperature 75 F in degrees Celsius is the answer. What do you think will happen if you were to run this command? Let's do it and see and this says the temperature 75°C is this formula. But I think what I wanted was for it to say that this is 23.889°C, not to just give back the formula like this. So, how do you make this print out the answer of the calculation itself. It turns out that there's something in Python called a formatted string that looks like this. Here, I've written F for formatted. So this is called f-string. And I've taken this calculation and put it within curly braces. That's what this is an open curly brace. And this is close curly brace also called a curly bracket. And if I run this with shift enter, it now says the temperature is 75 F in Celsius is 23.9 Celsius. So, this is a useful tool to insert calculations and other types of data into strings. And you'll be using this throughout subsequent lessons and courses as well. What the F character here does, is it tells Python this is not a regular string, it's a formatted string. And it tells Python "look for the things within curly braces and to do calculations within the curly braces." Let's look at another example. Let's say Isabel is 28 years old. You can print Isabel is 28 years old. Now in some countries there's a fun concept of what is someone's dog age. Because, you know, people live longer than dogs on average. Someone's so-called dog age is supposedly one-seventh their real human age. And so if I were to try to compute Isabel's dog age and do this, it wouldn't work. It just says, well, this is 28 divided by seven, but here's how you can fix it. I'm going to add f to tell it this is an f-string, add 28 over seven in curly braces. And if I do that, then it says Isabel is four dog years old. So, you saw both of these examples of an f-string. I'd like to walk through step by step, how Python interprets f-strings, so that you know exactly what's happening under the hood. When you print a string, that's not an f-string, that tells Python to display the string to screen. That's what the print command does. And Python looks at the opening and closing parentheses to find a string that it is asked to print, and the open and close quotation marks tells it where the string is. And so it prints Isabel is 28 years old character by character. In contrast, this is what happens with an f-string, same as before. The print command has open and close parentheses that tells Python what to print. And here we're giving the print command an f-string or formatted string. So Python looks to open and close quotation marks to look for the string. But it also looks for any opening and curly braces. In order to figure out which of the calculations you should carry out inside the curly braces. In this case, 28 divided by seven. When you do the calculation it's 4.0 and so it plugs in 4.0. And so it prints out Isabel is 4.0 dog years old. And that's why this is what it ends up printing. Now, this printed Isabel is 4.0 dog years old. What if you want to print it out as a whole number without the .0 decimal place? And so to do that you can ask the chatbot how do I modify this code to print the answer without any characters after decimal place. So here's the original code. And then the chatbot tells us, oh, you can use a colon 0.0 f format specifier through characters. So here's the modified code. Let me just copy this code and let's run this. And now it says Isabel is four dog years old. Just for fun, if you're curious, you can actually do .0 f up here as well. So it says 24 degrees. Or it turns out if you .1 F, it prints one decimal place .2F, it prints the answer to two decimal places. The important thing is not to remember this colon point zero f syntax. The important thing to remember is if you want to make a modification to your code, ask the chatbot to help you out with you know, how do I do this little thing? That's often a good way to help you accomplish the task you want. Now, so here we've used a single line f-string I want to show you just briefly the multi-line f-string. So this is a multi-line string as indicated by the triple quotes. And I've put F in front. And here I actually have two pairs of curly braces with calculations in between. And so this illustrates how to convert from the metric system to the American or the imperial system. And so 8 ounces of milk is this number of milliliters 100 ML of water is this fluid ounces. And if we run this, you know, it prints out these answers. And again just for fun, if you want to print this just to two decimal places, say, you can do quote 0.2 f here and here. And get these answers that look maybe a little bit simpler. Now, you may have noticed that while the f-string gives us the answer we want, it looks a little bit messy. You know, here there's a formula right in the middle of a string. In the next lesson, we will go through a pretty fundamental concept of programming languages, which is variables that will make your code much easier to read and much easier for others to use as well. After this video, I hope you try out the exercises at the bottom of the Jupyter notebook and practice with f-strings to see if you can get your code to print out some math calculations in a nicely formatted way. I hope you have fun with that, and I look forward to seeing you in the next video, where we'll talk about variables.