You can have as many elif as you need!!
This is the in between case... or cases. Think of the case when you're checking for RANGES
Under $5
Between $5 and $10
Between $10 and $25
Over $25
Spider-Man is preparing for his nightly patrol, but he needs to make sure he has enough web fluid to handle the challenges ahead. Depending on the mission—rooftop patrol, city patrol, or chasing down villains—different amounts of web fluid are required. Will Spider-Man have enough cartridges to swing into action, or will he need to refill his supplies? The fate of the night depends on it!
Ask the user to input the amount of web fluid Spider-Man has (an integer).
Display a menu with patrol types:
1: Rooftop patrol (requires 10 web cartridges).
2: City patrol (requires 20 web cartridges).
3: Villain pursuit (requires 50 web cartridges).
Use if/elif/else to check if Spider-Man has enough web fluid for the chosen patrol type.
Print a success or failure message.
BONUS TASK:
Can you randomly assign web cartridge cost instead of hard-coding it?
The Avengers have received multiple distress signals, but assembling the right team for each mission is critical. You’re tasked with selecting heroes to tackle specific challenges, from stealthy recon to all-out combat. Each mission has unique requirements, and it’s up to you to ensure the Avengers are ready. Missing a key hero could jeopardize the mission, so choose wisely. Can you assemble Earth’s Mightiest Heroes and save the day?
Ask the user how many avengers they would like in their list
Prompt the user to enter that many Avengers to assemble
Provide a menu of missions:
1: Recon mission
2: Heavy Combat
3: High-tech assault
Each of these missions has requirements, but don't let the user know what they are:
1: Recon mission (requires Black Widow and Hawkeye).
2: Heavy Combat (requires Hulk and Thor).
3: High-tech assault (requires Iron Man and Spider-Man).
Use if/elif/else to check if the required Avengers are in the user's list.
Print a success or failure message based on the mission requirements.
Mission Debrief: After each mission, print a detailed debrief that includes:
The names of the Avengers chosen for the mission.
A list of any missing required Avengers for the mission.
A "mission success" or "mission failed" status summary with a short description of why.
Avenger Abilities Check:
Add a second layer of requirements by assigning each Avenger a special ability (e.g., "tech," "strength," "stealth")
Ensure that the assembled team has at least one Avenger with the needed ability for the mission. Include abilities as part of the mission requirements.
Customize Team if you fail a mission
Allow the user to add or remove Avengers from their team after initially assembling it. For instance:
Add a new Avenger to the team.
Replace one Avenger with another.
After modifying the team, re-check if the team meets the mission requirements.
Stark Tower is under threat from potential intruders, and the cutting-edge security system is the first line of defense. Gaining access isn’t easy—you’ll need the right username and password to pass the initial scan. But that’s not all; a secret security code adds another layer of protection. Too far off the mark, and access is denied. Get through the layers of authentication, and you’ll be greeted with a top-secret mission tailored to your identity. Fail, and Stark Tower remains impenetrable. Will you crack the code and secure your place among the heroes?
Multiple If Elif Else will be needed.
Lists and list modifications may be needed
For loops and user prompts as well
String formatting, display, methods, etc...
Users enter credentials to access the system.
Multiple checks (e.g., username, password, and security code) ensure they are authorized.
User Login:
Prompt the user for a username and password. Check if they match pre-set values.
If incorrect, print an error message and terminate the program. Otherwise, proceed.
Security Code Check:
Prompt the user for a numeric security code.
Use if/elif/else to verify if:
Code is correct (access granted).
Code is close (off by ±2, print a "close but incorrect" message).
Code is completely incorrect (deny access).
Secret Mission Assignment:
If the user passes all checks, present them with a mission briefing based on the username.
Example: If the username is "Iron Man," assign a tech mission.