关于python的列表问题!!!

2025-05-01 07:44:46
推荐回答(1个)
回答1:

如下:

A = [1, 2, 3]
B = [4, 5, 6]
text = input("请输入:")
x = False
y = False
for s in text:
    if int(s) in A:
        x = True
    if int(s) in B:
        y = True
if x == True and y == True:
    print("OK")