Tuesday, 8 February 2022

Python practice programs for beginners - Day 12

 

Python practice programs for beginners - millioninformations


Day 11 solution:


Output:


Day 12: String Format

In the above program instead of using 

print(number3," is the greatest number")

We can use 

 print(f'{number3} is the greatest number')

f --> format

' --> single apostrophe used to say that it follows String formatting. 

{} -->  we can use the curly braces for the placeholders where we can mention the variable name.

Task:

Try to reprogram the above logic using String formatting.




1 comment :