In the Python programming language: Create a program that stores the names of the user's friends in a list. The program should allow a user to add friends to the list, remove friends from the list, and display the entire list of friends. A menu should be created that displays those options like so: 1 - View all 2 - Add Friend 3 - Remove Friend 4 - Exit The program should continue in a loop until the user selects exit. Hint: Use a function for each menu selection.
Q: 3- Write a python program that calculates the average of several numbers entered by the user. The…
A: Included two methods maximum and minimum which is user defined to find out minimum and maximum in…
Q: Now, modify it to do the following: modify the while loop to utilize tolower() or toupper().
A: Hi There, Please find your solution below, I hope you would find my solution useful and helpful. I…
Q: This is a special value that signals when there are no more items from a list of items to be…
A: Correct option: a
Q: This is a python program Sales Bar GraphWrite a program that reads in the sales for five stores from…
A: Note: We are authorized to answer one question at a time, since you have not mentioned which…
Q: . Continuously prompt the user to enter a word until the user enters q. 2. Store the entered words…
A: logic:- use while True to input a word continously. use if condition to check if word=='q'…
Q: python The intent of this program is to manage a set of contacts. Each contact will have data…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Write a python program that calculates the average of several numbers entered by the user. The…
A: Required: Write a python program that calculates the average of several numbers entered by the user.…
Q: A for construct is a loop that handles a list of items. So long as there are items to process, it…
A: A looping construct is basically considered to as a "for" construct. It may be used to process a…
Q: N PYTHON num.txt is a file that contains a list of scores. num.txt 10 25 36 45 89 42 54…
A:
Q: Create a new version of the restaurant ordering program BELOW that uses lists to look up menu items,…
A: def Menu(menu_items,menu_prices): print("Menu Card") count = 1 for i,j in…
Q: The project is a student management system which maintains student records in a simple text file.…
A:
Q: Write a program that has two functions main() and validate(). Use these two functions to get colors…
A: Please find the answer below :
Q: Modify the while loop to utilize tolower() or toupper(). Add default values to the to_celsius() and…
A: #include <iostream>#include <cmath>#include <cctype> // contains tolower function…
Q: Using Embarcadero C++ Program, write a complete program for a Menu System that will display the…
A: #include <iostream>using namespace std;int main(){ int choice, i, j, rowNum,…
Q: You have been asked to write a program that will allow your client Tigger Movie Rentals to keep…
A: #This function lists all the inventory names from the file.def display():with open("movies.txt") as…
Q: listHavingCourses # while loop execution while(1): # Ask user for a course courseEntryByUser =…
A: Algorithm: Start Implement a method named display() that takes a list of courses as argument Inside…
Q: structure. Create a menu with that gives the user three choices: Grade Book Grade Book O: Exit 1:…
A: Python program to implement a gradebook application''' # create an empty list of gradesgrades = []…
Q: PYTHON Language Programming Write a program that asks user for state name in a text document…
A: Given: Write a program that asks user for state name in a text document "state.txt" Please eneter…
Q: Create a program that allows users to enter a list of fruits. The program will also allow the user…
A: As the language is not specified answer is written in python Algorithm:1)Read the size of the…
Q: 1. count_perfect_squares This function takes a single argument, nums , Which is a list of numbers.…
A: Start import math def count_perfect_squares(nums): then count =0 if int(root + 0.5) ** 2…
Q: 3- Write a python program that calculates the average of several numbers entered by the user. The…
A: Both the Parts have been implemented in a single program in which I have Included two methods…
Q: mbers stored in the list special_list = [-99, 0, 44]. Sample output with input: 17 Not special…
A: Code: special_num = int(input())if special_num==-99 or special_num==0 or special_num==44:…
Q: Using Python: Step 1: Prompt the user to enter a string of their choosing. Store the text in a…
A: According to the information given:- We have to perform c - Number of non-whitespace characters w -…
Q: Python program language You and a friend sell your farm goods at a local farmers market 4 weekends…
A: Python program language You and a friend sell your farm goods at a local farmers market 4 weekends…
Q: Create a program that stores the names of the user's friends in a list. The program should allow a…
A: import java.util.ArrayList;import java.util.Scanner; public class Demo{ static…
Q: Program Description:in C language The project is a student management system which maintains student…
A: c program is given below
Q: using java The program has to evaluate arithmetic expressions using a BST for that purpose. The…
A: Lets see the solution in the next steps
Q: with python do whis: Edit or delete a user profile When the user chooses 2, the first thing that it…
A: File handling is a feature in programming through which user can modify, update, read or write in a…
Q: In python, Problem Description: You are hosting a party and do not have room to invite all of your…
A: Given: In python, Problem Description:You are hosting a party and do not have room to invite all of…
Q: Create a program that stores the names of the user's friends in a list. The program should allow a…
A: // Friend structure definition struct Friend{ // name for name of friend string name; //…
Q: Tasks: Assign a list of 5 friends name Allow these 5 friends to enter the number of apples that they…
A: Students=[]for num in range(5): x=input("Enter your Name: ") Students.append(x)
Q: Create two more functions (options #3 and #4 in your menu) by taking the to_celsius() and…
A: C++ program for the above two problems :
Q: IN C language Program Description: The project is a student management system which maintains…
A: C Program: add_student() function:First create a function to add the student with three parameters:…
Q: value to be inserted : 3 Please enter a new value to be inserted : 28 Please enter a new value to be…
A: Flowchart for Please modify the linked list program provided to produce the sample of output is as…
Q: ow, modify it to do the following: Add two more functions to handle another type of…
A: Here we write simple function using function overloading:…
Q: Write a menu-driven program (repeating or non-repeating) that displays four choices to the user to…
A: logic:- use while True loop to pop up menu use if elif else to match user input operation. In…
Q: 3- Suppose that you are working in a Mall and you are asked to create a program that calculates…
A:
Q: Create a program that asks the user to enter a series of positive numbers. The program should store…
A: n = []sum = 0print("Enter number of seires: ");i = int(intput())low = i high = i…
Q: In Python: Write a program that performs the following: Defines two sets s1, and s2, where each of…
A: Here , we take two sets. Input choice from the user and perform the following operations : Union…
Q: Write a C program to keep records and perform statistical analysis for a class of 20 students. The…
A: The C program below is used to keep records of 20 students for a class and it will perform…
Q: 5. Driver (the program that runs everything) a. Create a menu system as shown below: Welcome to the…
A: I have covered all a,b,c parts in the code below and attached output for each part. import…
Q: Write a program that automatically generates a Python list of 25 random integers between 0 and 100…
A: Algorithm : Step 1 : importing the required modules. Step 2 : declaring list and using for loop to…
Q: PYTHON PROGRAMMING LANGUAGE Create a new text document called names.txt (this is done by hand -…
A: Here, you need to write three functions such as main, readFunction and writeFunction. Main function…
Q: Python Programming Question Python 3 PROGRAM A: APROGRAM.py This program should use a main function…
A: PYTHON program to solve the given problem.
Q: 3- Write a program that calculates the average of several numbers entered by the user. The program…
A: HINT:- use regex to check for floating number. complete program along with screenshot is available…
Q: lanugage in python Question: Design a program that asks the user to enter a store's sales for each…
A: #In python as you know indentations play a major role and it signifies the end of loop tsales=0.0;…
Q: # Ask user for a course courseEntryByUser = input("Enter a course name or type 'EXIT' to stop: ") #…
A: Algorithm: Start Implement a method named display() that takes a list of courses as argument.…
Q: #include #include using namespace std; // declare functions void display_menu(); void…
A: SOURCE CODE : #include <iostream>#include <cmath> using namespace std; // declare the…
Q: Display a Python script with comments that shows a welcome message and asks the user for one of the…
A: books=[]print("Welcome to MyBookInventory App") def viewmenu(): print("(A) Add a new book…
Q: Create a program that asks the user to enter baby names. Then ask to enter each babies height. Then…
A: Here I have created the function getTallest(), and inside the function, I have calculated the length…
In the Python
Create a program that stores the names of the user's friends in a list. The program should allow a user to add friends to the list, remove friends from the list, and display the entire list of friends. A menu should be created that displays those options like so:
- 1 - View all
- 2 - Add Friend
- 3 - Remove Friend
- 4 - Exit
The program should continue in a loop until the user selects exit.
Hint: Use a function for each menu selection.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Create a program that stores the names of the user's friends in a list. The program should allow a user to add friends to the list, remove friends from the list, and display the entire list of friends. A menu should be created that displays those options like so: 1 - View all 2 - Add Friend 3 - Remove Friend 4 - Exit The program should continue in a loop until the user selects exit. Hint: Use a function for each menu selection.Create a program that stores the names of the user's friends in a list. The program should allow a user to add friends to the list, remove friends from the list, and display the entire list of friends. A menu should be created that displays those options like so: 1 - View all 2 - Add Friend 3 - Remove Friend 4 - Exit The program should continue in a loop until the user chooses to exit.In Python FormA. Create a sorted_grades application that can store up to 10 grades in order from highest to lowest in a list. The application should display a menu of options, which include “Enter a grade”, “Delete a grade”, “Display lowest grade”, “Display highest grade”, “Show grades”, and “Quit”. The list should initially contain all zeros (0).The algorithm for entering a grade is similar to:1. Find the appropriate position for the grade so that all grades are still in order from highest to lowest.2. Insert the grade3. Make certain that length of list remains the sameThe algorithm for deleting a grade is similar to:1. Find the element containing the grade to delete.2. If list empty tell user they can’ delete and if grade doesn’t exist, inform user no grade has been found.3. Use del function. Make certain the length doesn’t change and last element =0
- The function last_words in python takes one parameter, fname, the name of a text file, and returns a list containing the last word from each line of the file. For example, if the file contents are: apples are red bananas are yellow limes are green then the list ["red", "yellow", "green"] should be returned. NOTE: You may assume the file will contain no blank lines. BIG HINT: If line is a string representing a line of text (inside a for loop!), then L = line.split() creates a list of the words in the line. For example: Test Result L = last_words("wordlist1.txt") print(L) ['happy', 'sad', 'angsty', 'euphoric', 'maudlin']The python function first_words takes one parameter, fname, the name of a text file, and returns a list containing the first word from each line of the file. For example, if the file contents are: apples are red bananas are yellow limes are green then the list ["apples", "bananas", "limes"] should be returned.NOTE: You may assume the file will contain no blank lines.BIG HINT: If line is a string representing a line of text (inside of a for loop!), then L = line.split() creates a list of the words in the line.In python, create a sorted_grades application that can store up to 10 grades in order fromhighest to lowest in a list. The application should display a menu of options, whichinclude “Enter a grade”, “Delete a grade”, “Display lowest grade”, “Display highestgrade”, “Show grades”, and “Quit”. The list should initially contain all zeros (0). The algorithm for entering a grade is similar to:1. Find the appropriate position for the grade so that all grades are still in order fromhighest to lowest.2. Insert the grade3. Make certain that length of list remains the same The algorithm for deleting a grade is similar to:1. Find the element containing the grade to delete.2. If list empty tell user they can’ delete and if grade doesn’t exist, inform user no gradehas been found.3. Use del function. Make certain the length doesn’t change and last element =0Note: You can use the return to exit your function once you have found your element. Output should look similar to:…
- In Python: Write a program that performs the following: Defines two sets s1, and s2, where each of them contain the following: s1 = {1,2,4,5,6} s2= {1,3,4,7} Provides a menu with the following options: Union Intersection Difference Symmetric difference Display sets Exit The program stops once the user enters 6 (chooses to exit). When the user selects any of the other options, the corresponding operation is performed and the result is displayed. Please refer to the attached code which contains an example on how to implement a menu. Notes: I will leave the code organization for you, at this stage, you should be able to organize your program into functions in a proper way For the third operation (difference) find s1-s2. For the remaining operations it does not matter (for example, s1 union s2 is same s2 union s1)You have been asked to write a program that will allow your client Tigger Movie Rentals to keep track of their inventory.For the purposes of this program, we will assume they only have one copy of each movie in the inventory.Your program should:Continue until the user wishes to exit the program (use a loop)Give the user 4 options from a menu:list – list all moviesadd – add a moviedel – delete a moveexit – exit the programExample (does not have to match this exactly): Command Menu list - List all movies add - Add a movie del - Delete a movie exit - Exit program If the user enters an option other than those 4, provide an error message and ask the user to re-enter the selectionThe list of movies in inventory will be stored in a file named movies.txt (a starting version of the file is provided). You can assume the file is stored in the same directory as the .py file. When the list option is selected, a list of the current inventory will be displayed to the screenExample (does not have to…IN PYTHON, num.txt is a file that contains a list of scores. num.txt 10 25 36 45 89 42 54 create a program that reads the scores from num.txt file one line at a time. The program should display their total and average. since the number of scores is unknown, the program must keep looping until readline is blank. Sample Output: There are 7 scores The total is 301 The average is 43.0
- Please do this in Python: Write a program that allows the user to navigate lines of text in a file. The program should prompt the user for a filename, read the file and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line number range from 1 to the number of lines in the file. If the input is 0, the program quits. Otherwise, the program prints the text associated with that number.Snack bar menu Write a program in phyton that allows the user to choose from the following menu untilhe/she chooses to exit. The program should keep a running total of the chargesand then add 6% sales tax to calculate the final bill. Display the total to theuser.1) Personal Pizza $6.002) Pretzel $2.503) Chips $1.254) Hot Dog $3.755) ExitInput validation: The user must choose 1 - 5 from the menu.Example Output:Welcome to Yum Yum Snack Bar!Please choose from the following menu:1) Personal Pizza $6.002) Pretzel $2.503) Chips $1.254) Hot Dog $3.755) ExitEnter your choice here: 1Current total: $6.00Please choose from the following menu:1) Personal Pizza $6.002) Pretzel $2.503) Chips $1.254) Hot Dog $3.755) ExitEnter your choice here: 3Current total: $7.25Please choose from the following menu:1) Personal Pizza $6.002) Pretzel $2.503) Chips $1.254) Hot Dog $3.755) ExitEnter your choice here: 8Invalid choice. Must choose 1 – 5. Try again.Please choose from the following menu:1) Personal Pizza…1. Continuously prompt the user to enter a word until the user enters q. 2. Store the entered words in a list 3. Making use of the random module, your program should call word_selection() that randomly selects a word from the list and prints it 4. Include the guard for the main function: if __name__ == '__main__': main() Example: Enter a word (or ‘q’ to quit): Wallaby Enter a word (or ‘q’ to quit): Dingo Enter a word (or ‘q’ to quit): Platypus Enter a word (or ‘q’ to quit): q Wallaby