Strings (text) come with many useful built-in methods:
text = " Hello, World! "
print(text.upper()) # " HELLO, WORLD! "
print(text.lower()) # " hello, world! "
print(text.strip()) # "Hello, World!" (removes surrounding spaces)
print(len(text)) # 18 (number of characters)
first = "Alice"
last = "Smith"
full = first + " " + last
print(full) # Alice Smith
sentence = "red,green,blue"
colors = sentence.split(",")
print(colors) # ['red', 'green', 'blue']
email = "test@example.com"
print("@" in email) # True
Write a function format_name(first_name, last_name) that:
"[Last], [First]"Example: format_name(" alice ", "smith") → "Smith, Alice"
Click "Run" to execute your code.