#穴埋め門松列 import numpy as np a = "2 3 ?" a = a.split(" ") a = np.array(a) question = np.where(a=="?")[0] two = np.where(a=="2")[0] three = np.where(a=="3")[0] if(question==1): print(1,4) if(two==1): print(4) if(three==1): print(1)