我想检查在它们之间放置基本算术符号时7位数字是否可以达到100。
def is_hundred(n1,n2,n3,n4,n5,n6,n7):
p = [+,-,*,/]
for p1 in p:
for p2 in p:
for p3 in p:
for p4 in p:
for p5 in p:
for p6 in p:
if n1 p1 n2 p2 n3 p3 n4 p4 n5 p5 n6 p6 n7 == 100:
return "success"
如何用列表中的算术符号替换变量?