Quick actions

cmd+k|ctrl+k

Navigation

Languages

Formatted strings

Snippet info

Language

Python

Visibility

public

Author

andromachi.vasileiou

Created

2026-01-15T10:25:36.719125Z

Updated

2026-01-15T10:37:17.280297Z

#Formatted strings

name = "Johnny"
age = 55

print("hi " + name + ". You are " + str(age) + " years old\n")

print(f"hi {name}. You are {age} years old.")

print("hi {}. You are {} years old.".format("Johnny","55"))

print("hi {}. You are {} years old.".format(name,age))

print("hi {1}. You are {0} years old.".format(name,age))

print("hi {new_name}. You are {age} years old.".format(new_name="Sally",age=100))
INFO