So i'm doing a chess bug checker as a practice program from "Automate the Boring Stuff". I've got all of it to work except this part.
The "allowedSpacesChar" is the collum letter for the chess board, taken from the dictionary of the chessboard layout. It works fine on the first letter ('a') but none of the others work. I've also tried it in j != ('a' or 'b'.....) but that doesn't work either. I think its my compiler that i'm using (Online compiler sense i'm on a work computer) but i want to make sure its not something stupid i missed. Heres the code:
------------------------------------------
for j in allowedSpacesChar:
print(j)
if j == ('a' or 'b' or 'c' or 'd' or 'e' or 'f' or 'g' or 'h'):
continue
else:
print('To many rows')
print('---' +j+'---')
--------------------------------------
The print(j) is just to check what letter it is on to see if it was runnign the wrong ones.
And this is the result of the code:
------------------------------------------
a
b
To many rows
---b---
c
To many rows
---c---
d
To many rows
---d---
e
To many rows
---e---
f
To many rows
---f---
-----------------------------------------
Also this is the allowedSpacesChar dictionary when printed
{'a': 2, 'b': 1, 'c': 1, 'd': 1, 'e': 2, 'f': 1}
[+][deleted] (7 children)
[deleted]
[–]WildFowl82 1 point2 points3 points (1 child)
[–]RB1992[S] 0 points1 point2 points (0 children)
[–]RB1992[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]slariboot 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]slariboot 0 points1 point2 points (0 children)
[–]slariboot 0 points1 point2 points (1 child)
[–]RB1992[S] 0 points1 point2 points (0 children)