grade = 92
category = grade//10 # Well above average grade
match category:
case 10:
print("Excellent")
case 9:
print("Well above average")
case 8:
print("Above average")
case 7:
print("Average")
case 6:
print("Below average")
case _:
print("Not passing")
def my_function(status):
match status:
case 400:
return "Bad request"
case 404:
return "Not found"
case 418:
return "I'm a teapot"
case _:
return "Something's wrong with the internet"
# No need of break after case