From score to letter grade

I was wondering how to create a program that inputs a score on an assignment and then prints the corresponding letter grade. Assume the assignment is worth 30 points. If anyone could make me one as a good example to go off of that be great or give me some tips on it

for examples
27 to 30

24 to 26

21 to 23

18 to 20

17 or less

Sounds like homework…

Here’s a hint:

if score == 100:
    print("Perfect score")
elif 81 <= score < 100:
    print("You got an A")
elif score < 50:
    print("You fail!")

Fill in the gaps and adjust as needed.

When asking for help on creating a program (or any problem, for that matter), typically the best practice is to first work on your own implementation, demonstrate it, explain what you struggled with, and then ask for help. Directly asking for help/examples without the other steps can come across as trying to get others to do your work for you.

I’m not certain that we have a clearly defined policy on here for helping with homework problems, but I’d recommend checking out this StackOverflow question for effectively asking homework-related questions. Most of it applies fairly universally.

The majority of us are glad to help out where we can, but it’s a two-way street. (: