#๐Ÿ”’ my hw code isnt working why?

9 messages ยท Page 1 of 1 (latest)

heavy creekBOT
#

@leaden axle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

leaden axle
#

`def main():
name = input("What is your name? ")
print(name)

average = averagescore()

grade = gradelevel(average)

print(f"Your average score is {average}, so your grade level is {grade}.")

def averagescore():
scoreone = float(input("What is your first test score? "))
scoretwo = float(input("What is your second test score? "))
scorethree = float(input("What is your third test score? "))

average = (scoreone + scoretwo + scorethree) / 3

return average

def gradelevel(grade):
if grade >= 90:
grade = 'A'
elif grade >= 80:
grade = 'B'
elif grade >= 70:
grade = 'C'
elif grade >= 60:
grade = 'D'
elif grade == 59 - 0:
grade = 'F'
else:
grade = 'This score is invalid. Please try again.'

return grade

`main()

#

im thinking the grade = gradelevel(average) is the issue so i keep changing the variable but

#

im stuck tbh

#

fixed it

#

sorry lo

heavy creekBOT
#

@leaden axle

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ my hw code isnt working why?