Welcome to the Checkpoint Assignments. Let's See how well you're able to use lists and if/else statements. This will get a lot more complex once we start to introduce new data structures! Get Ready!!
Welcome to Sesame Street! Today, you’ll be helping The Count compare numbers using Python. Follow these steps carefully, and have fun coding along!
Make sure to use the sample code which you saw in the lesson in order to assist you!!
Prompt the user to enter 10 numbers (from 1 to 100)
Have the user then enter a comparison number (from 1 to 100)
Use a loop to check each number in the list as follows:
If a number is out of range, remove it from the list (Anything not between 1 and 100 inclusive)
Keep count of how many valid numbers you had, and display that at the end!!!
If the number is greater than or equal to the comparison number, display a fun message.
If the number is less than the comparison number, display a different message.
Count how many numbers are greater than or equal to and how many are less than the comparison number.
Format the Output as a Table (Bonus):
Create a nicely formatted table that shows each number and whether it was greater than, equal to, or less than the comparison number.
BONUS: Prompt Again - This is tricky!!!
If they had less than 10 valid numbers, prompt them again to make sure they get 10
EXAMPLE: If they had 6 valid numbers, prompt them for 4 additional numbers
Only do this 1 time, as if they don't have 10 numbers after this second round of prompting, they're just doing it to make you sad
BONUS: Do This Using by checking to see if it is in a list instead of direct comparison!!
You'll have to use in to do this
The Rebel Alliance is planning a top-secret mission, and you’re in charge of assembling the team! First, you’ll start with an initial list of characters. Then, you’ll decide who from that list should be added to the secret mission. Finally, you’ll let the user check if a specific character is part of the secret mission team.
Prompt a user to enter 6 Star Wars Characters
Once done, ask if the user wants to add each one to a secret mission
If so, add them to a secret mission list but DON'T SHOW THE USER THIS LIST
Finally, prompt the user to enter a character name to see if they are on the secret mission (you can prompt multiple times if you'd like, but you only need to do that 1 time for the program to be considered complete)
Now, It gets more difficult... You can add to your code above, but you must have a run of your code that accomplishes BOTH the easy and Hard Version. If you choose to combine them into 1 program, awesome!!!
USER MUST INPUT 10 Different Characters
3 RANDOM USERS must be picked from the main list and put into the secret mission list
You now get 5 guesses to correctly pick the 3 characters from the secret mission, but once you enter a character name, it is removed from the list of characters to guess from.
After each guess, display the possible characters to choose from
If you succeed, print a success message
If you fail, print a fail message.
Show total guesses, total correct, total fails, and calculate your correct guess percentage!!
You're going to need to use break to help with this task! It's something we haven't talked about yet, but I'll tell you this, if a loop comes across a break command, it will immediately jump out of the loop!! You need to do this if you guess all the secret mission members in less than 5 guesses
(There are other ways to do without break... just so you know. But, you have to figure it out)