我需要做这样的事情:
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")
U如何使black
和white
成为多个数字?
如果我输入x1 = 1
和x2 = 2
以及y1=1
和x2= 2
打印出我数字是否正确?
答案 0 :(得分:1)
如果有条件,请尝试
if (x1 and y1 in black) and (x2 and y2 in white):
print("Typed Numbers Is True")