🎯 What you will learn
- Join strings with +
- Repeat strings with *
- Make fun text art
👋 Let’s get started!
Strings are like word LEGO bricks 🧱. You can snap them together and even copy them! Let’s make the computer chatty.
🪜 Step by step
1. ➕ Joining strings
Use + to glue strings together. Don’t forget spaces!
print("Super" + "star")
print("Hello " + "friend")
2. ✖️ Repeating strings
Use * and a number to repeat a string.
print("ha" * 3)
print("⭐" * 5)
3. 🎨 Text art
Mix them to draw pictures with characters!
print(" /\\")
print(" / \\")
print("/____\\")
🧪 Try it!
Change the code and press ▶ Run to see what happens. You can’t break anything!
Make a cheer
print("Go " * 3 + "team! 🎉")
print("🌈" * 7)Build a sandwich of stars
print("⭐" * 3)
print("🍔 burger 🍔")
print("⭐" * 3)📖 Key words
Tap a card to flip it over!
- + (join)
- Glues strings together ➕
- * (repeat)
- Copies a string many times ✖️
- Character
- One letter, number or symbol 🔤
🏆 Challenge
Print a row of exactly 10 hearts using *.
Challenge
print("❤️" * 1)Knowledge Check Quiz
- What does this print?
- What does this print?
- Which symbol repeats a string?