number = 5.75253545
print(f'{number:.2f}')
>>>5.75
number = 4
print(f'{number:03d}')
>>>004
print(f'{"apple" : >30}')
print(f'{"apple" : <30}')
print(f'{"apple": <30} banana')
print(f'{"apple" : ^30}')
large_number = 126783.6457
print(f'Currency format for large_number with two decimal places: ${large_number:.2f}')
>>> Currency format for large_number with two decimal places: $126783.65
print(f'Currency format for large_number with two decimal places and comma seperators: ${large_number:,.2f}')
>>> Currency format for large_number with two decimal places and comma seperators: $126,783.65
[]
list()
lst = [1, 1.23, True, 'hello', None] print(lst) >>> [1, 1.23, True, 'hello', None]
lst = list((1, 1.23, True, 'hello', None)) # notice the double round brackets print(lst) print(len(list)) print(lst[0]) >>> [1, 1.23, True, 'hello', None] 5 1