##Example 1 if col=="a" or col=="c" or col=="e" or col=="g": if row%2==0: print("That square is white.") else: print("That square is black.") elif col=="b" or col=="d" or col=="f" or col=="h": if row%2==1: print("That square is white.") else: print("That square is black.") else: print("not valid") ######################### ##Example 2 row = input("What row? ") column = input("What column? ") if row=="1" and column=="b" or row=="1" and column=="d" or row=="1" and column=="f" or row=="1" and column=="h": print("That square is white.") elif row=="2" and column=="a" or row=="2" and column=="c" or row=="2" and column=="e" or row=="2" and column=="g": print("That square is white.") elif row=="3" and column=="b" or row=="3" and column=="d" or row=="3" and column=="f" or row=="3" and column=="h": print("That square is white.") elif row=="4" and column=="a" or row=="4" and column=="c" or row=="4" and column=="e" or row=="4" and column=="g": print("That square is white.") elif row=="5" and column=="b" or row=="5" and column=="d" or row=="5" and column=="f" or row=="5" and column=="h": print("That square is white.") elif row=="6" and column=="a" or row=="6" and column=="e" or row=="6" and column=="e" or row=="6" and column=="g": print("That square is white.") elif row=="7" and column=="b" or row=="7" and column=="d" or row=="7" and column=="f" or row=="7" and column=="h": print("That square is white.") elif row=="8" and column=="a" or row=="8" and column=="e" or row=="8" and column=="e" or row=="8" and column=="g": print("That square is white.") else: print("That square is black.") ######################### ##Example 3 num = int(input("What row? ")) let = str(input("What column? ")) if (num % 2 == 1 and (let == "a" or let == "c" or let == "e" or let == "g")) or (num % 2 ==0 and (let == "b" or let == "d" or let == "f" or let == "h")): print("That square is black") else: print("That square is white") ######################### ##Example 4 row=int(input("What row is the square in?")) column= input("What column is the square in?") if column == "a": if row == 1: print("The square is black.") elif row== 2: print("The square is white.") elif row == 3: print("The square is black.") elif row== 4: print("The square is white.") elif row == 5: print("The square is black.") elif row== 6: print("The square is white.") elif row == 7: print("The square is black.") elif row== 8: print("The square is white.") elif column == "b": if row== 1: print("The square is white.") elif row == 2: print("The square is black.") elif row== 3: print("The square is white.") elif row == 4: print("The square is black.") elif row== 5: print("The square is white.") elif row == 6: print("The square is black.") elif row== 7: print("The square is white.") elif row == 8: print("The square is black.") elif column == "c": if row == 1: print("The square is black.") elif row== 2: print("The square is white.") elif row == 3: print("The square is black.") elif row== 4: print("The square is white.") elif row == 5: print("The square is black.") elif row== 6: print("The square is white.") elif row == 7: print("The square is black.") elif row== 8: print("The square is white.") elif column == "d": if row== 1: print("The square is white.") elif row == 2: print("The square is black.") elif row== 3: print("The square is white.") elif row == 4: print("The square is black.") elif row== 5: print("The square is white.") elif row == 6: print("The square is black.") elif row== 7: print("The square is white.") elif row == 8: print("The square is black.") elif column == "e": if row == 1: print("The square is black.") elif row== 2: print("The square is white.") elif row == 3: print("The square is black.") elif row== 4: print("The square is white.") elif row == 5: print("The square is black.") elif row== 6: print("The square is white.") elif row == 7: print("The square is black.") elif row== 8: print("The square is white.") elif column == "f": if row== 1: print("The square is white.") elif row == 2: print("The square is black.") elif row== 3: print("The square is white.") elif row == 4: print("The square is black.") elif row== 5: print("The square is white.") elif row == 6: print("The square is black.") elif row== 7: print("The square is white.") elif row == 8: print("The square is black.") elif column == "g": if row == 1: print("The square is black.") elif row== 2: print("The square is white.") elif row == 3: print("The square is black.") elif row== 4: print("The square is white.") elif row == 5: print("The square is black.") elif row== 6: print("The square is white.") elif row == 7: print("The square is black.") elif row== 8: print("The square is white.") elif column == "h": if row== 1: print("The square is white.") elif row == 2: print("The square is black.") elif row== 3: print("The square is white.") elif row == 4: print("The square is black.") elif row== 5: print("The square is white.") elif row == 6: print("The square is black.") elif row== 7: print("The square is white.") elif row == 8: print("The square is black.")