1
Combine Strings
Create two variables: first_name = "John" last_name = "Doe" Combine them into full_name with a space between. Display: John Doe
Strings are text enclosed in quotes.
You can combine (concatenate) strings with +:
first = "Hello"
second = "World"
message = first + " " + second
print(message) # Hello World
You can also repeat strings with *:
print("Ha" * 3) # HaHaHa
Create two variables: first_name = "John" last_name = "Doe" Combine them into full_name with a space between. Display: John Doe
Display "Ho" repeated 3 times. Output should be: HoHoHo
Create a variable name = "Alice". Display: Hello, Alice! Hint: You need to combine "Hello, " + name + "!"