在Python中,可以使用以下幾種方式來打印字符串:
print("Hello, World!")
name = "Alice"
age = 30
print("My name is {} and I am {} years old.".format(name, age))
name = "Bob"
age = 25
print(f"My name is {name} and I am {age} years old.")
message = """
This is a
multi-line
string.
"""
print(message)
greeting = "Hello, "
name = "John"
print(greeting + name)