1.7k views
3 votes
Create a simple program that calls a function call gradeCalculated, in the main area the user is asked to enter their grade from 0-100. (Python)

1 Answer

0 votes

Answer:

def gradeCalculated(score):

if score < 60:

letter = 'F'

elif score < 70:

letter = 'D'

elif score < 80:

letter = 'C'

elif score < 90:

letter = 'B'

else:

letter = 'A'

return letter

def main():

grade = int(input("enter your grade from 0-100: "))

print("Letter grade for ",grade,"is:",gradeCalculated(grade))

if(grade>80):

print("You are doing good! keep it up!!")

else:

print("You have to get work hard")

main()

Step-by-step explanation:

See attached image for output

Create a simple program that calls a function call gradeCalculated, in the main area-example-1
User Chrislusf
by
5.9k points