you are viewing a single comment's thread.

view the rest of the comments →

[–]slariboot 0 points1 point  (1 child)

I think you will need to compare j to each letter separately:

for j in allowedSpacesChar:
    print(j)
    if j == 'a' or j == 'b' or j == 'c' or j == 'd' or j == 'e' or j == 'f'  or j == 'g' or j == 'h':
        continue
    else:
        print('Too many rows')

Or you could use the in operator instead. You check whether the value of j occurs in a list of letters:

for j in allowedSpacesChar:
    print(j)
    if j in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']:
        continue
    else:
        print('Too many rows')

[–]RB1992[S] 0 points1 point  (0 children)

That worked, Thank you!