Need help Python multiple numbers VAR

I need to make something like this:

black = ['1', '3', '5', '7']
white = ['8', '6', '4', '2']
x1 = int(input("type x1"))
x2 = int(input("type x2"))

y1 = int(input("type y1"))
y2 = int(input("type y2"))
if x1 == y1 == black and x2 == y2 == white:
    print("Typed Numbers Is True")

How can U make black and white multiple numbers? If I type x1 = 1 and x2 = 2 and y1=1 and x2= 2 print type me Numbers is true?

Answer

try this if condition,

if (x1 and y1 in black) and (x2 and y2 in white):
    print("Typed Numbers Is True")

Update:

it’s because your list black and white all the number is string but you take input as int, try to take int in the or remove int in the input section.

Leave a Reply

Your email address will not be published. Required fields are marked *