if (80 <= m <= 100):
g = "A"
elif (70 <= m < 80):
g = "B"
elif (60 <= m < 70):
g = "C"
elif (50 <= m < 60):
g = "D"
elif (m < 50):
g = "U"
This is basically a grade measuring piece of code that takes in value m, meaning mark, and obtains grade g. Is there a shorter not necessarily more pythonic way for the same purpose?
Thanks in advance.