while testcount < 100:
num1=randint(0,10)
num2=randint(0,10)
num3=randint(0,10)
num4=randint(0,10)
num5=randint(0,10)
numo=[num1,num2,num3,num4,num5]
if #there are two 7s# in numo:
testcount=testcount+1
num_of_successes=num_of_successes+1
else:
testcount=testcount+1
print(num_of_successes,"out of 100 there were two 7s")
如何檢測'numo'中是否有兩個7?即使它不使用這些代碼中的大部分,也可以使用 。Python在字符串中檢測兩個相同的東西
你想查看numo中是否有兩個7 – The6thSense