Вы находитесь на странице: 1из 1

score = raw_input('Enter your score (between 0.0 & 1.

0): ')
# Ensures that input is a number, if not, sets error condition
try :
score = float(score)
except :
score = -1
# Sets error condition if input is greater than 1
if score > 1.0 :
score = -1
if score >= 0.9:
print 'A'
elif score >= 0.8:
print 'B'
elif score >= 0.7:
print 'C'
elif score >= 0.6:
print 'D'
elif score >= 0:
print 'F'
else:
#Error message
print 'Please enter a valid score.'

Вам также может понравиться