Build a Greeting with Concatenation
Beginner · Write the code · from Python Strings: Create, Access, Slice, and Manipulate Text
From the lesson: Python Strings: Create, Access, Slice, and Manipulate Text
Think about your phone. Almost everything you see on the screen is text: names in your contacts, messages from friends, search results, notifications. Behind the scenes, all of that text is handled by strings.
Read the lessonYou are given two variables: first_name set to "Ada" and last_name set to "Lovelace". Create a variable called greeting that combines them into a message, then print it.
Expected output:
Hello, Ada Lovelace! Welcome to Python.Use string concatenation (+) to build the greeting.
first_name = "Ada"
last_name = "Lovelace"
# Create the greeting using concatenation (+)
# Print the greeting
More Strings exercises
- Get the First and Last CharacterBeginner
- Reverse a StringBeginner
- Predict the Slice OutputBeginner
- Fix the Bug: Mutating a StringBeginner
- Check If a Word Is in a SentenceBeginner
- Extract a Domain from an Email AddressBeginner
All Python exercises · 50 practice problems · Python Fundamentals quiz