
Create a new program called, "PassingValues" in Repl.it using python. In this program you are going to make a couple of functions that will use parameters. Follow the prompts below in order to create your program. Writing step-by-step instructions for
- 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.
Again, these steps are very challenging (not because of functions and parameters) because it is hard to explain exactly how to create a program line-by-line. Do your best and if needed, ask your teacher for assistance ( they have an answer key :) )
NOTE: You MUST use a procedure / function that includes parameters as part of the Create Performance Task.

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images

- Over the years, people have created a few nicknames for me. One that sticks without me telling me to call me that name is "Denck." It works great with anyone whose name ends with an "er". We are going to create a function called "nickName" which takes in one parameter. This parameter stores the name you want to create the nickname for. If the name ends with an er, return the name with the er removed. If the name does not have an er then return the full name back to the program.arrow_forwardNeed help on this question and can you explain how as well?arrow_forwardI know you guys are using AI. Don't you dare give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forward
- Write the code in Python. Please write the code using input and if…else statements. Include a header comment on each code. Make sure it’s readable and well-formatted code.arrow_forwardI have provided the code I have written. All I need you to do is to rewrite the code. I need you to rewrite the comments, rename all the variables, and shift the code. It should look different once you have edited it. I would like to see another format for this code. It is in C-Programming. I think it shouldn’t take so long. Take your time, please! I really appreciate any help you can provide! CODE STARTS HERE: #include<stdio.h>#include<stdlib.h> struct node{ int key; struct node *left, *right;}; // A utility function to create a new BST nodestruct node *newNode(int item){ struct node *temp = (struct node *)malloc(sizeof(struct node)); temp->key = item; temp->left = temp->right = NULL; return temp;} // A utility function to do inorder traversal of BSTvoid inorder(struct node *root){ if (root != NULL) { printf("("); inorder(root->left); printf("%d", root->key); inorder(root->right); printf(")");…arrow_forwardI need help solving this in PYTHONarrow_forward
- Here is the main function in a program int main () { int x = 30; //more code goes here someFunction (x) ; cout « x; return 0; } Assume the heading for someFunction is written correctly with an integer parameter named x, and that this is the body of that function: { x = x * 20; //more code goes here } What will be the output? Just enter a number. If there would be an error, enter -999arrow_forwardI can't seem to figure this out.. for python You have a business that cleans floors in commercial space and offices. You charge customers $0.45 per square yard, and some customers require multiple cleanings every month. You need two custom functions for your business. The first function takes a floor's length and width in feet and returns the area in square yards. The second void function takes the area, charge per square yard, and number of monthly cleanings as arguments and prints the cleaning cost. This latter function uses selection logic to print different output for single and multiple monthly cleanings (see Sample Outputs). Use a properly named constant for the charge per square yard, too.arrow_forwardQuestion 14 papa .Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forward
- "Develop a Java function named display_album_info that prints details about an album titled 'Euphoric Symphony. The function should output the following information: Artist's name and release year. Brief description of the album's theme or concept. Tracklist with song titles and durations. Musical genre and target audience. Average rating on a scale of 1 to 5. Memorable lyrics or standout musical moments. Contact information for inquiries (email: music@euphoricsymphony.com, phone: 555-4321). Call the function to display the album information."arrow_forwardI need three examples of code with comments when it's appropriate to use a comment.arrow_forwardMonthly Payment Program (in the attached photo), update it with the following in java code: If applicable, remove hard coding for the principal, annual interest rate and number of years. Replace these with Input Dialog Boxes requesting data be entered. The calculation should remain the same. Replace the output area with a showMessage box. Allow the user to request a detailed display of the payment schedule. This will include the ending balance and interest paid per month in a line-by-line display. Add a loop to the program allowing the user to continue entering new data as many times as they like (all input and output should be displayed in dialog boxes).arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





