Vanellope von Schweetz is coding a new arcade game, but sometimes glitches happen! Your task is to build a Python program where users create an arcade character, receive a random power-up, and find out if their power-up gets glitched in a funny way. You will practice:Â
✔ User input & output
✔ Functions with default values
✔ Named parameters
✔ Function chaining (functions working together to process information)
✔ Random number generation (power-ups & glitches)
🎮 What’s Happening?
The user will enter a character name for the arcade game.
They can choose how their name appears (ALL CAPS, all lowercase, or Title Case).
The function should provide a default name if the user doesn’t enter one.
✅ What You Need to Do:
Write a function called format_name().
Ask the user for a character name.
Ask how they want it formatted: "upper", "lower", or "title".
If the user doesn’t enter a name, use "Player One" as a default value.
Use named parameters when calling this function.
🎮 What’s Happening?
Every character gets a random power-up that gives them a special ability in the game.
If the user doesn’t specify a power-up, it should randomly choose one from a list.
✅ What You Need to Do:
Create a function called get_powerup().
Use a list of power-ups (e.g., "Super Speed", "Pixel Jump", "Coin Magnet").
If "random" is passed as an argument, select a power-up randomly.
Use default values & named parameters when calling this function.
🎮 What’s Happening?
Not everything in Vanellope’s game works as expected! There is a 1 in 3 chance that a power-up gets a funny glitch.
If a glitch occurs, it modifies the power-up description (e.g., "Super Speed... but only in reverse!").
✅ What You Need to Do:
Create a function called apply_glitch().
Pass in the power-up as an argument.
Generate a random number to decide if a glitch happens.
If a glitch occurs, randomly modify the power-up with a funny twist.
Use default values & named parameters when calling this function.
Example Glitch Message
Example No-Glitch Message
🎮 What’s Happening?
Instead of writing one long function, we break the program into smaller functions that work together.
Each function processes information and passes it to the next.
This keeps the program organized and easy to read.
✅ What You Need to Do:
Use function calls inside other functions to pass information automatically.
The sequence should be:
format_name() → Formats the user’s name
get_powerup() → Gets a random power-up
apply_glitch() → Decides if a glitch happens
display_results() → Prints everything
An Example is Shown Below... Be Creative!!
🎮 Offer a list of characters for the user to select from
🎮 Offer a list of power ups for the characters to choose from
🎮 Turn This Into a Game Like Below!!!