Frank
0
Q:

python print format

# using format() method 
print('I love {} for "{}!"'.format('Geeks', 'Geeks')) 
  
# using format() method and refering  
# a position of the object 
print('{0} and {1}'.format('Geeks', 'Portal')) 
  
print('{1} and {0}'.format('Geeks', 'Portal')) 
8
print('{} {}'.format(1, 2))
1
print(f'I love {Geeks} from {Portal}')
1
print('{} {}'.format('one', 'two'))
1
'{} {}'.format('one', 'two')
1
'{:10.5}'.format('xylophone')
0

New to Communities?

Join the community