when index of more than one tanks are used as input, argv[0] is a list
tankIndices = self.getNodeTankIndex()
if len(argv) == 1:
if argv[0] in tankIndices:
tankIndices = argv[0]
else:
tankIndices = self.getNodeTankIndex(argv[0])
For the judgment, if argv[0] in tankIndices:, it can not check whether all the elements of argv[0] are in tankIndices. one solution is as follows:
tankIndices = self.getNodeTankIndex()
if len(argv) == 1:
result = [True for c in argv[0] if c in tankIndices]
if result:
tankIndices = argv[0]
else:
tankIndices = self.getNodeTankIndex(argv[0])
when index of more than one tanks are used as input, argv[0] is a list
For the judgment,
if argv[0] in tankIndices:
, it can not check whether all the elements of argv[0] are in tankIndices. one solution is as follows: