Answers for "print formatted string in python"

0

print format python

print('{:0.3f} {:0.3f}'.format(y, z))
Posted by: Guest on January-18-2021
0

print formatted string in python

print("Geeks : %2d, Portal : %5.2f" % (1, 05.333))
 
# print integer value
print("Total students : %3d, Boys : %2d" % (240, 120))
 
# print octal value
print("%7.3o" % (25))
 
# print exponential value
print("%10.3E" % (356.08977))
Posted by: Guest on August-20-2021
0

formatted string in python

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

Python Answers by Framework

Browse Popular Code Answers by Language