Yellow Hat – Strings & Dictionaries
beginner25 XP
Interactive Projects
Build Mad Libs and interactive stories using input() and strings
Interactive Projects
Mad Libs!
Python
name = input("Hero's name: ")
verb = input("Action verb: ")
place = input("A place: ")
story = f"One day, {name} decided to {verb} to {place}!"
print(story)Name Analyser
Python
name = input("Your name: ")
print(f"{name} has {len(name)} letters")
print(f"Reversed: {name[::-1]}")⌨️
Type it yourself
Don't just read it — type the example from above into the box, press Run ▶, and watch what happens. Typing it yourself is how it really sticks! Stuck? Tap Show example.
Python · Playground
Output
Press ▶ Run to see your code come to life…Quick check
01/2
What does name[::-1] do to a string?