How to Print line with variable output using fstring ?
name = ‘Hemant Kumar’
age = 32
print(f”{name:-{5}}”)
How to set the padding between output of two variables with fstring ?
name = ‘Hemant Kumar’
age = 32
print(f”{name:{10}} {age:{5}}”)
How to create a list of tuples and present it with f-string ?
profiles = [(‘Name’,’Age’,’Sex’),(‘Hemant’,34,’Male’),(‘Billu’,2,’Female’)]
for name,age,sex in profiles:
print(f”{name:{10}}{age:
how to add space while presenting variables using f strings ?
print(f”Age:{age:{5}}”)