Heres what I have roster = {} for i in range(5): jersey_number = int(input(f"Enter player{i+1}'s jersey number:\n")) rating = int(input(f"Enter player{i+1}'s rating:\n")) roster[jersey_number] = rating sorted_keys = sorted(roster.keys()) print("ROSTER") for key in sorted_keys: print(f"Jersey number:{key}, Rating:{roster[key]}") menu = "MENU\na - Add player\nd - Remove player\nu - Update player rating\nr - Output players above a rating\no - Output roster\nq - Quit\n" while True: print(menu) option = input("Choose an option:\n") if option == "a": jersey_number = int(input("Enter a new player's jersey number:")) rating = int(input("Enter the player's rating:\n")) roster[jersey_number] = rating elif option == "d": jersey_number = int(input("Enter a jersey number: ")) if jersey_number in roster: del roster[jersey_number] else: print("Jersey number not found.") elif option == "u": jersey_number = int(input("Enter a jersey number:\n")) if jersey_number in roster: rating = int(input("Enter a new rating for player:\n")) roster[jersey_number] = rating else: print("Jersey number not found.") elif option == "r": rating = int(input("Enter a rating:\n")) print(f"ABOVE {rating}") for key in roster: if roster[key] > rating: print(f"Jersey number: {key}, Rating: {roster[key]}") elif option == "o": sorted_keys = sorted(roster.keys()) print("ROSTER") for key in sorted_keys: print(f"Jersey number: {key}, Rating: {roster[key]}") elif option == "q": break else: print("Invalid option. Please try again.")   The output gives me lots of new line issues

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Heres what I have

roster = {}
for i in range(5):
jersey_number = int(input(f"Enter player{i+1}'s jersey number:\n"))
rating = int(input(f"Enter player{i+1}'s rating:\n"))
roster[jersey_number] = rating
sorted_keys = sorted(roster.keys())
print("ROSTER")
for key in sorted_keys:
print(f"Jersey number:{key}, Rating:{roster[key]}")
menu = "MENU\na - Add player\nd - Remove player\nu - Update player rating\nr - Output players above a rating\no - Output roster\nq - Quit\n"
while True:
print(menu)
option = input("Choose an option:\n")
if option == "a":
jersey_number = int(input("Enter a new player's jersey number:"))
rating = int(input("Enter the player's rating:\n"))
roster[jersey_number] = rating
elif option == "d":
jersey_number = int(input("Enter a jersey number: "))
if jersey_number in roster:
del roster[jersey_number]
else:
print("Jersey number not found.")
elif option == "u":
jersey_number = int(input("Enter a jersey number:\n"))
if jersey_number in roster:
rating = int(input("Enter a new rating for player:\n"))
roster[jersey_number] = rating
else:
print("Jersey number not found.")
elif option == "r":
rating = int(input("Enter a rating:\n"))
print(f"ABOVE {rating}")
for key in roster:
if roster[key] > rating:
print(f"Jersey number: {key}, Rating: {roster[key]}")
elif option == "o":
sorted_keys = sorted(roster.keys())
print("ROSTER")
for key in sorted_keys:
print(f"Jersey number: {key}, Rating: {roster[key]}")

elif option == "q":
break
else:
print("Invalid option. Please try again.")

 

The output gives me lots of new line issues

 

 

 

 

F Bb F S X
C
O
S
WMAA Bookmarks sis Student and Parent... A1 Algebra 1 Common...
learn.zybooks.com/zybook/GRCCCIS116Brown Spring2023/chapter/7/section/1?content_resource_id=71003647
Canvas Login Infor... WCSS Colors Desmos | Graphing....
=zyBooks My library > CIS 116: Introduction to Computer Programming home > 7.1: LAB*: Program: Soccer team roster (Dictionaries)
q Quit
Expected output
ends with
Choose an option:
Input
ABOVE 4
Jersey number: 4, Rating: 5
Jersey number: 66, Rating: 9
Jersey number: 84, Rating: 7
MENU
a Add player
d
Remove player.
u - Update player rating
-
-
SIS
r - output players above a rating
0
o Output roster
q- Quit
Choose an option:
9:Compare output
Output differs. See highlights below. Special character legend
1
4
6
9
21
5
47
8
83
2
IMI
▸
(A) FA (
English Research
0
{
?
Screen capture. now
+00
Screenshot taken
Show in folder
Edit
Help/FAQ Michael Vander Ark
Copied to clipboard
Delete
k
Mar 30
@x
Search + V
9:21 → 8
:
Transcribed Image Text:F Bb F S X C O S WMAA Bookmarks sis Student and Parent... A1 Algebra 1 Common... learn.zybooks.com/zybook/GRCCCIS116Brown Spring2023/chapter/7/section/1?content_resource_id=71003647 Canvas Login Infor... WCSS Colors Desmos | Graphing.... =zyBooks My library > CIS 116: Introduction to Computer Programming home > 7.1: LAB*: Program: Soccer team roster (Dictionaries) q Quit Expected output ends with Choose an option: Input ABOVE 4 Jersey number: 4, Rating: 5 Jersey number: 66, Rating: 9 Jersey number: 84, Rating: 7 MENU a Add player d Remove player. u - Update player rating - - SIS r - output players above a rating 0 o Output roster q- Quit Choose an option: 9:Compare output Output differs. See highlights below. Special character legend 1 4 6 9 21 5 47 8 83 2 IMI ▸ (A) FA ( English Research 0 { ? Screen capture. now +00 Screenshot taken Show in folder Edit Help/FAQ Michael Vander Ark Copied to clipboard Delete k Mar 30 @x Search + V 9:21 → 8 :
F Bb F S X
C
O
S
WMAA Bookmarks sis Student and Parent... A1 Algebra 1 Common...
learn.zybooks.com/zybook/GRCCCIS116Brown Spring2023/chapter/7/section/1?content_resource_id=71003647
Canvas Login Infor... WCSS Colors Desmos | Graphing....
=zyBooks My library > CIS 116: Introduction to Computer Programming home > 7.1: LAB*: Program: Soccer team roster (Dictionaries)
Your output ends
with
Expected output
ends with
83
2
r
8
q
ABOVE 8
Jersey number: 6, Rating: 9
MENU
a
Add player
d Remove player
u - Update player rating
r - output players above a rating
0
o Output roster.
q
Quit
-
Choose an option:
ABOVE 8
Jersey number: 6, Rating: 9
MENU
a
d
0
o
q
SIS
Add player
Remove player.
u Update player rating
r - output players above a rating
Output roster.
Quit
-
-
Choose an option:
IMI
(A) FA (
English Research
{
Screen capture • now
Screenshot taken
Show in folder
Edit
? Help/FAQ Michael Vander Ark
Copied to clipboard
Delete
Screenshot taken. now
Show in folder
k
Mar 30
@x
Search + V
9:21 → 9
:
Transcribed Image Text:F Bb F S X C O S WMAA Bookmarks sis Student and Parent... A1 Algebra 1 Common... learn.zybooks.com/zybook/GRCCCIS116Brown Spring2023/chapter/7/section/1?content_resource_id=71003647 Canvas Login Infor... WCSS Colors Desmos | Graphing.... =zyBooks My library > CIS 116: Introduction to Computer Programming home > 7.1: LAB*: Program: Soccer team roster (Dictionaries) Your output ends with Expected output ends with 83 2 r 8 q ABOVE 8 Jersey number: 6, Rating: 9 MENU a Add player d Remove player u - Update player rating r - output players above a rating 0 o Output roster. q Quit - Choose an option: ABOVE 8 Jersey number: 6, Rating: 9 MENU a d 0 o q SIS Add player Remove player. u Update player rating r - output players above a rating Output roster. Quit - - Choose an option: IMI (A) FA ( English Research { Screen capture • now Screenshot taken Show in folder Edit ? Help/FAQ Michael Vander Ark Copied to clipboard Delete Screenshot taken. now Show in folder k Mar 30 @x Search + V 9:21 → 9 :
Expert Solution
steps

Step by step

Solved in 6 steps

Blurred answer
Knowledge Booster
Binary Search Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education