Extra Credit Calculation in Python
Assign sum_extra with the total extra credit received given list test_grades. Full credit is 100, so anything over 100 is extra credit.
Sample output for the given program with input: 101 83 107 90
Sum Extra = 1 + 7 = 8
user_input= input() test_grades= list(map(int, user_input.split())) sum_extra = 0 for i in test_grades: if i>100 : sum_extra = sum_extra + i-100 print('Sum extra:',sum_extra)
Hope this is helpful. Write back to me in case you need help with your python task. I generally reply back within 24 hours. You can connect with me on Whatsapp also: +918602715108
Comments
Post a Comment