for/else
nums = [60, 70, 30, 110, 90]
for n in nums:
if n > 100:
print("%d is bigger than 100" %n)
break
else:
print("Not found!")
Also see: Python Tips
Comments
nums = [60, 70, 30, 110, 90]
for n in nums:
if n > 100:
print("%d is bigger than 100" %n)
break
else:
print("Not found!")
Also see: Python Tips