是否有其他方法可以通过一些验证或更无组织的方式编写此子例程?
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}]