1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
n200080 [17]
2 years ago
13

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 jer

sey 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)
Computers and Technology
1 answer:
Reika [66]2 years ago
5 0

Answer:

  1. jersey_dict = {}
  2. for i in range(5):
  3.    j_num = int(input("Input Jersey's number (0-99): "))
  4.    rating = int(input("Input rating (1 - 9): "))  
  5.    jersey_dict[j_num] = rating  
  6. sorted_key = []
  7. for i in jersey_dict.keys():
  8.    sorted_key.append(i)
  9. sorted_key.sort()
  10. for i in sorted_key:
  11.    print(str(i) + ":" + str(jersey_dict[i]))

Explanation:

Firstly, define an empty dictionary (Line 1).

Next, use a for loop to prompt user to input five Jersey's number and rating and keep the input to the dictionary (Line 3-6). Next, create a list to hold the dictionary keys (Line 8-10). Use build in method, sort to arrange the keys in the list in ascending order (Line 12 ). At last, print the dictionary element by looping over the value in the sorted_key list (Line 14-15).

You might be interested in
To add text to a blank slide layout, _____.
Basile [38]
B, draw the text box
3 0
3 years ago
What is outlook used for?
Arte-miy333 [17]
Outlook is used for mainly emails. It also keeps track of your calendar, has contact and tasks.
4 0
3 years ago
Read 2 more answers
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to
tester [92]

<u>Explanation:</u>

Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.

Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.

Using pseudocode do the following;

  • determine the inputs and outputs of the problem
  • arrange the identified problem into micro-tasks
  • describe each micro-tasks in the pseudocode
  • Test the pseudocode by solving the problem.

                       

3 0
3 years ago
A stored program computer is designed to compute precisely one computation, such as a square root, or the trajectory of a missil
mr Goodwill [35]

Answer: False

Explanation:

 The given statement is false as, a stored program computer is one of the type of computer system which storing the program instruction in the form of electronic memory.

  • It perform different types of tasks in the sequence and it also enables the digital computer system more effective and flexible.
  • In this stored program computer the program instructions are get stored on the plugboards.

Therefore, the given statement is false.

4 0
3 years ago
Computers can be positioned on a network in different ways relative to each other. true false
Likurg_2 [28]
False they cant do that
4 0
3 years ago
Other questions:
  • Is techonology better? Lot of votes needed.
    5·1 answer
  • Krystal recorded her times for all her cross-country meets this season. To sort her data showing the lowest times first, what wi
    14·2 answers
  • when reading a recipe ingredients witch substance make the rice an unhealthy choice if it is present in a high amount
    13·1 answer
  • NEED HELP FAST
    13·2 answers
  • What are the Database used in RDBMS and DBMS<br>please answer immediately​
    10·1 answer
  • Consider the unsigned decimal number 35. What is the value in hexadecimal?<br><br> 3510 = _______ 16
    9·1 answer
  • Step 1: Configure the initial settings on R1. Note: If you have difficulty remembering the commands, refer to the content for th
    10·1 answer
  • Which administrative tool can you use to check your computer's health or troubleshoot problems with the operating system or soft
    11·2 answers
  • Which of the following is an example of a content management system (CMS)?
    12·2 answers
  • A parent process calling _____ system call will be suspended until children processes terminate.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!