可能重复:
带有 if/elif 语句的多个条件
如果满足多个条件之一(“或”),我将在 Python 中的循环内触发循环。该脚本似乎跳过了“if”语句并在不满足所需条件的情况下进入内部循环。
代码
# Begin TestCase
# Main logic: execute RemoteController macro, if expected state == true, set 'Success', else: Fail
for macroname_n in range (32):
handler("RemoteController", "SET", "[{0}_{1}_{2}]".format(testcase, macroname_n, platform), "")
result = pbc_json(disk, testcase_area, testcase, platform, filename_n, coord_n)
filename_n += 1
coord_n += 1
if macroname_n == 15 or 20:
success_counter = 0
for extra_loop in range(15):
handler("RemoteController", "SET", "\"down 4\"", "")
result = pbc_json(disk, testcase_area, testcase, platform, filename_n, coord_n)
filename_n += 1
if result >= 50:
success_counter += 1
if success_counter <> 15:
result = 0
提前致谢!