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 16:10
Drag each label to the correct location on the imagelist the doā€™s and donā€™ts of safeguarding your password.keep yourself loggedin when you leave your computer.donā€™t write your password down and leave it whereothers can find it.share your password with your friends.each time you visit a website,retain the cookies on your computer.use a long password with mixed characters.
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ăā€”, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ăā€” slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
Answers: 1
You know the right answer?
Please code it with python! Thank you

There was a mistake in entering grades on Canvas....
Questions
question
Chemistry, 08.01.2021 21:30
question
History, 08.01.2021 21:30
Questions on the website: 13722362