Tuesday, 8 February 2022
Python practice programs for beginners - Day 12
Day 11 solution:
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.
Subscribe to:
Post Comments
(
Atom
)
nice. all the best.
ReplyDelete