subject

Add the beginning comments at the top of the program. In the first part of your program, create a for loop that runs three times:
Inside the for loop, prompt the user for an integer
Prompt the user for another integer
Call the function compare (you are going to create this function next)
Pass the variables that you used for the integer inputs from above
Create a function called compare (remember the function definition should go at the top of the program) and use two variables in the parameters of the function:
Inside of the function, create an if / elif / else structure that compares the two values passed into the function
If one value is less than the other, output that to the user (Ex: 2 is less than 4)
Elif the other value is less than the other output something similar (Ex: 4 is less than 9)
Else, output that they are equal to each other
That is it for the first part of the program.
Next, create an empty list called names.
Create a loop that runs 6 times:
Inside of the for loop, prompt the user for a name
Append the name to the list
Outside of the for loop, prompt the user for how many people they would like to vote off the island.
Call the function eliminate and pass the variable you used from step 7 to it.
Also, this function will return a value, so store this back function call back to a new variable.
Create a function called eliminate and create a variable to use as the parameter:
Inside the function, randomly shuffle (use the shuffle() method) all the values in the list (you will need to import random at the top of the program)
Then using a for loop, loop it as many times as the value that was passed to the function:
Inside the for loop, remove one name from the list (use the pop() method)
Outside the for loop, but still inside the function, return the list of remaining people
Underneath where you left off in step 8, print the remaining people that are left: those that did not get voted off the island.
WILL GIVE BRAINIEST!

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
question
Computers and Technology, 24.06.2019 12:00
Jack is assisting his younger sibling mary with her mathematics assignment, which includes a study of the number system. jack explains to mary that whole numbers are counting numbers that could be used to record the number of fruits in a basket. which data type represents whole numbers? a.integers.b.floating-point numbers. c.strings.d.boolean
Answers: 1
You know the right answer?
Add the beginning comments at the top of the program. In the first part of your program, create a f...
Questions
question
Mathematics, 05.04.2021 03:30
question
Mathematics, 05.04.2021 03:30
question
Mathematics, 05.04.2021 03:30
question
Mathematics, 05.04.2021 03:30
question
Mathematics, 05.04.2021 03:30
Questions on the website: 13722367