heading = "Centered string"
print( f'{heading:=^30}' ) #| = is for the char to print | ^ Is to center the text | 30 is the total length of the final string
'=======Centered string========'
id1 = '9'
id2 = '100'
t = 'abcd
f'{id1} | {t}'
f'{id2} | {t}'
|
|
f'{id1} | {t}'
f'{id2:4} | {t}'
|
|
i = -1234567
print( f'{integer:,}' )
'-1,234,567'
sep = '_'
print( f'{integer:{sep}}' )
'-1_234_567'
nb = 1234567.9876
print( f'{floating_point:,.2f} )
'1,234,567.99'
jane = Person("Jane Doe", 25)
|
"I'm Jane Doe, and I'm 25 years old."
|
|
"Person(name='Jane Doe', age=25)"
|
variable = "Some mysterious value"
|
variable = 'Some mysterious value'
|
|
variable='Some mysterious value'
|
|
variable= 'Some mysterious value'
|
|
variable ='Some mysterious value'
|