Answers for "format string print python"

1

formatted string in python

>>> name = "world"
>>> print(f"Hello {name}!)"
'Hello world!'
Posted by: Guest on December-18-2020
1

python format string

>>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
'Coordinates: 37.24N, -115.81W'
>>> coord = {'latitude': '37.24N', 'longitude': '-115.81W'}
>>> 'Coordinates: {latitude}, {longitude}'.format(**coord)
'Coordinates: 37.24N, -115.81W'
Posted by: Guest on June-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language