Picture this: you’re the wild-eyed announcer at the Smash Bros. Face-Off Frenzy, hyping up the crowd for the next big brawl! Your job? Spotlight a single fighter with a beefy stat sheet—think 5-7 juicy details like name, series, move, speed, power, wins, and maybe a secret edge.
Start by crafting this fighter’s dictionary from scratch, but here’s the twist: the crowd’s shouting demands! They want you to tweak the stats live—maybe juice up the power or zap away a weak spot. You’ll need to loop through every stat with flair, dazzling the audience with a full rundown using items().
Then, let the fans pick a stat to zoom in on—show off those keys() in a menu and grab their choice with input.
Oh, and the pros in the back want a sorted stat list (sorted()), so line ‘em up alphabetically for the big screen.
Watch out—mess up a stat, and the crowd’ll boo with a KeyError, so keep a try/except handy. Can you hype your fighter to victory, or will they get KO’d by a typo?
Craft a dictionary for your fighter with 5-7 stats—think 'name', 'series', 'move', 'speed', 'power', 'wins', and a wild card like 'edge' (Day 1 vibes). Hardcode it to kick things off!
BONUS: Have The User Input These! Ask for confirmation before you add it
Let the crowd tweak it live:
Prompt the user to see if they want to update specific stats
Use keys( ) to prompt which stats they can change - Display them for user to choose!
Use update() to boost a stat (or even add a new one) (like 'power') based on user input
Once updated, loop through the whole stat sheet with items():
print each key-value pair with some announcer swagger
Sort those stats alphabetically using sorted() on the keys—give the pros a clean, ordered rundown
Wrap it in a try/except—catch any KeyError boos if the crowd picks a stat that’s not there
Essentially, you're trying to use at least 3 of the methods from this lesson in your program. Have some fun and feel free to tweak it!
Welcome to the Smash Team Takedown Tournament, where you’re the mastermind behind a 3v3 Smash Bros. squad! Your team’s a list of three fighter dictionaries, each loaded with 5-7 stats—name, series, move, speed, power, team (A or B), and maybe a wild card. The stakes are high: the crowd’s chanting for chaos! Let them pick a fighter to boost with a new stat via input, then zap a stat with del to keep ‘em lean. Loop through with items() to hype Team A’s full stats—every detail counts. Use keys() to build a menu so fans can pick a fighter and see their sorted stats (sorted()). Survey all moves with values(), then use set() to reveal unique series in the lineup. Can your squad dominate the arena, or will they get smashed into next week?
Kick things off with one star fighter—hardcode a dictionary for a single Smash Bros. legend (like Mario) with 5-7 stats:
'name', 'series', 'move', 'speed', 'power', 'team' (A or B), and a cool extra like 'edge'
For your next 2 fighters:
prompt for their details (name, series, move, speed, power, team, and an optional wild card) via user input, building each dictionary on the fly and adding them to your team list.
Make sure you are getting the SAME KEYS that you used for your hard-coded fighter!
Boost a fighter based on input:
Ask for a fighter’s name from your team (or even better, show a menu or at least show who is available), then prompt for a new stat name and value (e.g., 'boost': 'Super Jump') to add to their dictionary
Ask the user if there's a stat from a fighter they want to remove
If so, remove a stat with del—delete one stat (like 'edge' or 'speed')
Show off Team A’s stats—use items() to loop through your list and print every key-value pair for fighters on Team A
Create a menu with keys()—list all fighter names from your team, let the user pick one with input, then display that fighter’s stats sorted alphabetically with sorted()
List all moves—extract and print every 'move' stat from your team using values()
Find unique series—use set() to collect all 'series' values and show the distinct franchises in your lineup
Handle errors with try/except—catch any KeyError if the user picks a nonexistent fighter or stat