IN PYTHON PLEASE
This
(1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)
Ex:
Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. The program initially outputs the menu, and outputs the menu after a user chooses an option. The program ends when the user chooses the option to Quit. For this step, the other options do nothing. (2 pts)
Ex:
MENU a - Add player d - Remove player u - Update player rating r - Output players above a rating o - Output roster q - Quit Choose an option:
(3) Implement the "Output roster" menu option. (1 pt)
Ex:
ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(4) Implement the "Add player" menu option. Prompt the user for a new player's jersey number and rating. Append the values to the two
Ex:
Enter a new player's jersey number: 49 Enter the player's rating: 8
(5) Implement the "Remove player" menu option. Prompt the user for a player's jersey number. Remove the player from the roster (delete the jersey number and rating). (1 pt)
Ex:
Enter a jersey number: 4
(6) Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. (1 pt)
Ex:
Enter a jersey number: 23 Enter a new rating for player: 6
(7) Implement the "Output players above a rating" menu option. Prompt the user for a rating. Print the jersey number and rating for all players with ratings above the entered value. (2 pts)
Ex:
Enter a rating: 5 ABOVE 5 Jersey number: 66, Rating: 9 Jersey number: 84, Rating: 7 ...
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 4 images
This program will store roster and rating information for a football team. Coaches rate players during tryouts to ensure a balanced team.
(1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)
Ex:
Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. The program initially outputs the menu, and outputs the menu after a user chooses an option. The program ends when the user chooses the option to Quit. For this step, the other options do nothing. (2 pts)
Ex:
MENU a - Add player d - Remove player u - Update player rating r - Output players below a rating o - Output roster q - Quit Choose an option:
(3) Implement the "Output roster" menu option. (1 pt)
Ex:
ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(4) Implement the "Add player" menu option. Prompt the user for a new player's jersey number and rating. Append the values to the two
Ex:
Enter a new player's jersey number: 49 Enter the player's rating: 8
(5) Implement the "Remove player" menu option. Prompt the user for a player's jersey number. Remove the player from the roster (delete the jersey number and rating). (1 pt)
Ex:
Enter a jersey number: 4
(6) Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. (1 pt)
Ex:
Enter a jersey number: 23 Enter a new rating for player: 6
(7) Implement the "Output players below a rating" menu option. Prompt the user for a rating. Print the jersey number and rating for all players with ratings below the entered value. (2 pts)
Ex:
Enter a rating: 5 BELOW 5 Jersey number: 23, Rating: 4 Jersey number: 30, Rating: 2
This program will store roster and rating information for a football team. Coaches rate players during tryouts to ensure a balanced team.
(1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)
Ex:
Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. The program initially outputs the menu, and outputs the menu after a user chooses an option. The program ends when the user chooses the option to Quit. For this step, the other options do nothing. (2 pts)
Ex:
MENU a - Add player d - Remove player u - Update player rating r - Output players below a rating o - Output roster q - Quit Choose an option:
(3) Implement the "Output roster" menu option. (1 pt)
Ex:
ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ...
(4) Implement the "Add player" menu option. Prompt the user for a new player's jersey number and rating. Append the values to the two
Ex:
Enter a new player's jersey number: 49 Enter the player's rating: 8
(5) Implement the "Remove player" menu option. Prompt the user for a player's jersey number. Remove the player from the roster (delete the jersey number and rating). (1 pt)
Ex:
Enter a jersey number: 4
(6) Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. (1 pt)
Ex:
Enter a jersey number: 23 Enter a new rating for player: 6
(7) Implement the "Output players below a rating" menu option. Prompt the user for a rating. Print the jersey number and rating for all players with ratings below the entered value. (2 pts)
Ex:
Enter a rating: 5 BELOW 5 Jersey number: 23, Rating: 4 Jersey number: 30, Rating: 2
- A Python dictionary that returns a list of values for each key. The dictionary will contain information about my favorite books, including the title, author, and year of publication. The key will be the title of the book, and the values will be a list containing the author and the year of publication. favorite_books = { "The Great Gatsby": ["F. Scott Fitzgerald", 1925], "To Kill a Mockingbird": ["Harper Lee", 1960], "1984": ["George Orwell", 1949]} NOTE: You can replace the book details as your need in above code. Next, modify the invert_dict function from Section 11.5 of "Think Python" to invert my dictionary. The modified function will need to turn each of the list items into separate keys in the inverted dictionary. def invert_dict(d): inverse = dict() for key in d: vals = d[key] for val in vals: if val not in inverse: inverse[val] = [key] else: inverse[val].append(key) return inverse Here, the…arrow_forwardIN PYTHON THANK YOUarrow_forwardThis program will store roster and rating information for a football team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)Ex: Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ... (2) Implement a menu of options for a user to modify the roster. Each…arrow_forward
- You have been given the following lists of students and their test scores: names=['Joe','tom','bob','sue','sally'] Scores=[10,23,13,18,12]Write a function, makeDictionary , that takes the two lists and returns a dictionary with the names as the keys and the scores as thevalues. Assign the result of makeDictionary to scoreDict .calculate the average of all the scores in scoreDict in python.arrow_forwardPlease answer the Q1 in python with showing the codearrow_forwardHow do you do this? Comment each step out!!arrow_forward
- 4- Given a dictionary: capitals= {'CHINA': 'BEIJING','CUBA': 'HAVANA', 'USA': 'WASHINGTON, D.C.'} Write a python program to print keys and values in new line. Example output: CHINA BEIJING CUBA . . .arrow_forwardPlease answer the ques in python with showing the codesarrow_forwardPlease in python, MUST use dictionaries This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)Ex: Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Jersey number: 4, Rating: 5 Jersey number: 23, Rating: 4 Jersey number 30, Rating: 2 ... (2) Implement a menu of options for…arrow_forward
- 3. form_letter This function takes a list of dictionaries, where each dictionary has an entry of key "name" and entry of key "date". It returns a list of strings, where each output string has replaced the name and the date into the following template. Use the format method on strings -- see Lecture 8! The template should be exactly like this -- just copy-paste this into your code. TEMPLATE = """Dear {name},Your appointment is at {time}.Thanks very much.-- bimmy""" It can be either local to your function, or global in your Python file. Your choice! Sample calls should look like this. >>> form_letter([{"name":"Alex", "time":"three o'clock"},{"name":"Laura", "time":"the stroke of midnight"}])["Dear Alex,\nYour appointment is at three o'clock.\nThanks very much.\n-- bimmy", 'Dear Laura,\nYour appointment is at the stroke of midnight.\nThanks very much.\n-- bimmy']arrow_forwardWrite python program named "YourStorelD_Inventory.py" focusing on inventory data: You have a list of dictionaries representing items in a store. Each dictionary contains the item name, quantity in stock, and the price per unit. Perform the following tasks: (a) Calculate and display the total value of the inventory (sum of quantity * price for each item). (b) Identify and display the item with the highest total value (quantity * price). (c) Implement a function that takes a user-input item name and searches for it in the list. If found, display the quantity in stock and the total value of that item; if not found, print a message indicating that the item is not in the inventory. (d) Implement a sorting algorithm of your choice to sort the items based on their total values in descending order and display the sorted list. Make sure to incorporate functions for each task and display the results in the main function with appropriate messages.arrow_forwardUsing the Dictionary below, create a game that picks a random number based on the length of the dictonary. Using that random number, prompts the user for the capital of that state (the key for your dictionary) - Use the code snipet below Your program must prompt the user by asking "What is the capital of XXX:" and XXX is the state name. Your program should compare the guess to the actual capital for that state. If the guess is correct, increment the number of correct guesses. If the guess is wrong, increment the numner of incorrect guesses. When the user types in quit in eithe uppercase or lowercase, the program should print out the results of the game by telling the payer you had XX correct responses and YY incorrect responses. Then the program should end. Make sure to do the Outline and Logic parts for your program. You can include your Python code in yout Word document, or submit it as a Python (;py) file Upload your work to this assignment when completed. # Pick…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