Combining Spells
Hoppy wants to combine two words into a sentence. We can use the + symbol for this, just like math!
String Concatenation
first = "Super" last = "Hoppy" name = first + last print(name) # Result: "SuperHoppy"
Notice there is no space? Computers do exactly what you tell them. If you want a space, you must add it.
name = first + " " + last # Result: "Super Hoppy"
Your Mission
1
Combine
Create a variable full_name by combining "Hoppy" and "Frog".
2
Add Space
Make sure there is a space between them: "Hoppy Frog".
3
Print
Print full_name.
Suggested SolutionClick to expandClick to collapse
full_name = "Hoppy" + " " + "Frog" print(full_name)
Advanced TipsWant more? Click to expandClick to collapse
You can also multiply strings! Try multiplying a string by a number.
print("Ha" * 3)What do you think happens? It prints "HaHaHa"!
pymain.py
Loading...
Terminal
Terminal
Ready to run...