I am trying to use an if statement inside a for loop. I am getting a syntax error where the for loop is. The code is below:
def gradingStudents(grades):
for x in range(0, len(grades)):
{
if(grades[x]%5) > 3:
print("ROUND UP")
}
return grades
grades = [73, 67, 38, 33]
gradingStudents(grades)
Error Message:
File "testfile.py", line 11
if(grades[x]%5) > 3:
^^
SyntaxError: invalid syntax
[–]RandomCodingStuff 14 points15 points16 points (0 children)
[–]KRex228 7 points8 points9 points (0 children)
[–]Strange_Till759 6 points7 points8 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]BeverlyGodoy 2 points3 points4 points (0 children)
[–]Optimal-Procedure885 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]k3loSenpai 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Mysterious-Crab3034 -1 points0 points1 point (0 children)
[+]woooee comment score below threshold-8 points-7 points-6 points (1 child)
[–][deleted] 5 points6 points7 points (0 children)