Python 4.3: Formatted strings

We will continue with my code and here we will see the formatted chains, until now we have seen that to make a concatenation we need the plus and here I send it another method I want to copy this one you pasted me in bottom I will put f for the format I removed this one putting on a single line I'm going to add the braces and inside I'm going to put the name so the variable that I want to display and I do the same thing here like this I put age I don't need to put str the because it converts automatically, I'll run the program, your age 34 but you see that the line that normally displays as the next line. I'm going to do the same thing and show you another method with this so here we use the percentage s. We don't need to put the f in front we'll delete it like this and percentage s and then put percentage put the element display that is age plus 1 so I'm going to put parenthesis age plus 1 I'm going to run my code, you'll see that there's no difference between your age two you see that it's displayed the same way There is really no difference between the two and if we don't want to say on the basis that we take this method the method with the percentage is displayed several element or several data so I will copy this I'm going to copy this part and add at the bottom here we're going to put a percentage S and at this level we're going to put a percentage s then I put a percentage parenthesis name comma age that's how it's done I run my code you see the three lines written in a different way are displayed in the same way by different I'll show another trick if we want to display a text on several lines we need to do a print the print except that inside instead of putting the double ribs you'll put three to be able to display on several lines like this, I show you how it works for you are an ormation about the python language. I rerun my code one you see that it displays several lines so we can try this function to display several elements or a text on several lines well if you show our trick against the print function with this function we can display several variables of different nature I told you I'm going to put here titi comma 15 comma Tonton comma distance comma a point 67 I run my code see that it is displayed normally so the print function can be used to display several variable of different nature we have seen here. Well we say to each other very soon for a next video on the synthesis.