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, 21.06.2019 16:00
Answer me pls is an algorithm that has been coded into something that can be run by a machine.
Answers: 3
question
Computers and Technology, 21.06.2019 18:40
Adna sequence encoding a five-amino acid polypeptide is given below. …… …… locate the sequence encoding the five amino acids of the polypeptide, and identify the template and coding strand.
Answers: 1
question
Computers and Technology, 22.06.2019 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
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, 27.08.2021 05:10
question
Mathematics, 27.08.2021 05:10
question
Mathematics, 27.08.2021 05:10
question
Mathematics, 27.08.2021 05:10
Questions on the website: 13722362