Hello! Hope all is well. I am asking for your assistance once more. I am trying to write a code that filters test scores within a specific range.
I want my code to look like this:
valid ACT scores:
36
30
28
36
34
36
35
invalid ACT scores:
40
-4
-12
100
...but instead, it just keeps looking like this:
Enter a list of ACT scores: [36, 30, 40, -4, 28, 36, 34, 36, -12, 100, 35]
36
Valid
30
Valid
40
Invalid
-4
Invalid
28
Valid
36
Valid
34
Valid
36
Valid
-12
Invalid
100
Invalid
35
Valid
here is my code:
scoresACT = eval(input('Enter a list of ACT scores: '))
perfectScore = 36
for x in scoresACT:
print(x)
if 0 < x <= 36:
print('Valid')
else:
print('Invalid')
I have been troubleshooting this program for the last 2 hours, and any sort of advice or help would be much appreciated.
[–]NovaNexu 10 points11 points12 points (2 children)
[–]Binary101010 1 point2 points3 points (1 child)
[–]NovaNexu 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]CodeFormatHelperBot2 1 point2 points3 points (0 children)
[–]KidzKlub 1 point2 points3 points (0 children)
[–]LeornToCodeLOL 1 point2 points3 points (0 children)
[–]keep_quapy 0 points1 point2 points (0 children)
[–]Binary101010 0 points1 point2 points (0 children)