Skip to content

Instantly share code, notes, and snippets.

@Spandhana9788
Created March 1, 2020 15:55
Show Gist options
  • Save Spandhana9788/0f53bbd44ac32139b8af82522192ff3c to your computer and use it in GitHub Desktop.
Save Spandhana9788/0f53bbd44ac32139b8af82522192ff3c to your computer and use it in GitHub Desktop.
Write a program to prompt for a score between 0.0 and 1.0. If the score is out of range, print an error. If the score is between 0.0 and 1.0, print a grade using the following table: Score Grade >= 0.9 print A, Grade >= 0.8 print B, Grade >= 0.7 print C, Grade>= 0.6 print D, Grade < 0.6 print F If the user enters a value out of range, print an e…
score=float(input("enter the number"))
if score>1.0 or score<0.0:
print("error")
elif score>=0.9:
print("A")
elif score>=0.8:
print("B")
elif score>=0.7:
print("C")
elif score>=0.6:
print("D")
else:
print("F")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment