Format allows you to format your strings for formatted (thus the name) output
I won't be able to explain it's use entirely here, but can give you the basics.
Basic usage:
Please refer to The StringFormatCookbook as a reference when you want to do something more elaborate.
Try some of the examples.
I won't be able to explain it's use entirely here, but can give you the basics.
Basic usage:
mood = ['a great', 'a miserable', 'a mundane', 'a happy', 'an exhilarating', 'rather OK'] mindex = 4 print('Today is {} day'.format(mood[mindex]))result:
Output:Today is an exhilarating day
it can be used for simple variables, and lists alsoPlease refer to The StringFormatCookbook as a reference when you want to do something more elaborate.
Try some of the examples.