Python Forum
Cant get grade part of code to work correctly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cant get grade part of code to work correctly
#1
trying to get the grade part of the code to work, the rest seems to work fine

print("enter 5#s")
num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
num5 = int(input())
numbers = [num1, num2, num3, num4, num5]
numsum = sum(numbers)
print("sum is:", numsum)
#Above list is working
def Average(numbers):
    return sum(numbers) / len (numbers)
print("AVG = ", round(Average(numbers), 2))
#determine letter grade below
score = int(Average(numbers)
if score >= 90:
  print('Grade is = A')
elif score >= 80:
  print('Grade is = B')    
elif score >= 70:
  print('Grade is = C')
elif score >= 60:
  print('Grade is = D')
else:
  print('Grade is = F')
Reply


Messages In This Thread
Cant get grade part of code to work correctly - by Expel - Jul-08-2019, 10:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I can't for the life of me get this basic If statement code to work CandleType1a 8 564 May-21-2024, 03:58 PM
Last Post: CandleType1a
  Why can I not see the code correctly in Python IDLE.? Trump 8 997 Apr-04-2024, 07:47 AM
Last Post: jonesphedra
  Remove part of the code hack3rcon 5 884 Jan-08-2024, 10:25 AM
Last Post: hack3rcon
  hi need help to make this code work correctly atulkul1985 5 1,051 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  newbie question - can't make code work tronic72 2 858 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Beginner: Code not work when longer list raiviscoding 2 990 May-19-2023, 11:19 AM
Last Post: deanhystad
  Why doesn't this code work? What is wrong with path? Melcu54 7 2,137 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  Code used to work 100%, now sometimes works! muzicman0 5 1,691 Jan-13-2023, 05:09 PM
Last Post: muzicman0
  color code doesn't work harryvl 1 1,051 Dec-29-2022, 08:59 PM
Last Post: deanhystad
  Coding problem portfolio grade max70990 1 819 Dec-11-2022, 12:30 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020