Different way to write a subroutine

60 views Asked by At

Would there be another way to write this subroutine with some validation or a more unorganized way of doing it?

months=['January','February','March','April','May','June','July','August','September','October','November','December']
total=0
student=input('Enter new name: ')
for x in range (12):
    score=float(input('Enter score for ' + months [x] + ' out of 10: '))
    while score > 10 or score <1 or score %1 != 0 :
        float(score=input('Invalid','Enter score for' + months [x]+'out of 10: '))
        total=total+score
        print('Your total Score is', total)
        names.update[{name:totalscore}]
0

There are 0 answers