A string is a sequence of characters enclosed in quotes.
single = 'Hello'
double = "World"
multi = """This is a
multi-line string"""
first = "Hello"
second = "World"
result = first + " " + second # "Hello World"
text = "hello world"
text.upper() # "HELLO WORLD"
text.capitalize() # "Hello world"
text.replace("world", "Python") # "hello Python"
The modern way to include variables in strings:
name = "Alice"
age = 25
print(f"My name is {name} and I am {age} years old")
Interactive Visualization