1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| year = "2018" cur = f'current year is {year}' cur = f'current year is {year!s}' cur = f'current {year=}'
yes_votes = 42_572_654 no_votes = 43_132_495 percentage = yes_votes / (yes_votes + no_votes) '{:-9} YES votes {:2.2%}'.format(yes_votes, percentage) '{0}, {1}'.format('Hello', "World") '{action}, {target}'.format(action='Hello', target='World')
str(year) repr(year)
|