subject

Please code it with python! Thank you

There was a mistake in entering grades on Canvas. We need your help writing a Python script that can help us maintain the class roster. The functionalities you need to implement are explained below. For each of the functionalities, you may want to implement a separate function.

Adding a student to the roster:
When you receive the "add NAME GRADE" command, you need to add one student with the name "NAME" and the grade "GRADE" to the roster. For example, "add Simon 20" will add Simon to the roster and his grade will be 20. If the entered grade was greater than 100, or if the student’s name is already on the roster, then don’t add the student to the roster and instead print "Failed to add NAME", with NAME being the name of the student you were asked to add to the roster. If adding the student was successful, you will print "Added NAME", with NAME being the name of the student you just added.
Updating the grade of an existing student:
When you receive the "update NAME GRADE" command, you will have to check if the student with the name "NAME" exists in the roster. If so, update their grade to "GRADE" and print "Updated NAME’s grade" with NAME being the name of the student. Otherwise, print "NAME does not exist in the roster".

Printing the roster:
When you receive the "print" command, you need to print the entire roster in the output in the same order that you added students to the roster. For example, if we have {‘Narges’: 0, ‘Benedict’: 1} on our roster, it will print:
Narges: 0
Benedict: 1

Exiting the program:
When you receive the "exit" command, you will terminate the program and stop receiving inputs from the user.
Sample Input 1:

add narges 0
print
exit
Sample Output 1:

Added narges
narges: 0
Sample Input 2:

add Benedict 1
add Rafael 11
add michael 111
exit
Sample Output 2:

Added Benedict
Added Rafael
Failed to add michael
Sample Input 3:

add Katelyn 99
print
update Katelyn 100
print
update Rafael 98
exit
Sample Output 3:

Added Katelyn
Katelyn: 99
Updated Katelyn's grade
Katelyn: 100
Rafael does not exist in the roster
Sample Input 4:

add Ben 10
add Bao 11
update bao 12
print
update Bao 12
print
exit
Sample Output 4:

Added Ben
Added Bao
bao does not exist in the roster
Ben: 10
Bao: 11
Updated Bao's grade
Ben: 10
Bao: 12
Sample Input 5:

update Yama 80
add Yama 80
add Yama 90
update Yama 100
print
exit
Sample Output 5:

Yama does not exist in the roster
Added Yama
Failed to add Yama
Updated Yama's grade
Yama: 100

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:00
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
What does a cascading style sheet resolve a conflict over rules for an element? a. the rule affecting the most content wins b. the rule affecting the most content loses c. the rule with the most specific selector loses d. the rule with the most specific selector wins
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
You know the right answer?
Please code it with python! Thank you

There was a mistake in entering grades on Canvas....
Questions
question
Mathematics, 12.03.2020 16:52
question
Mathematics, 12.03.2020 16:52
question
Mathematics, 12.03.2020 16:53
Questions on the website: 13722362