name = 'Alice'
age = 25
print('My name is %s and I am %d years old.' % (name, age))
name = 'Bob'
age = 30
print('My name is {} and I am {} years old.'.format(name, age))
name = 'Charlie'
age = 35
print(f'My name is {name} and I am {age} years old.')
value = 3.14159
print('The value is {:.2f}'.format(value)) # 輸出保留兩位小數
name = 'David'
age = 40
print('My name is {0} and I am {1} years old. {0} is a {job}.'.format(name, age, job='teacher'))