[英]python if statement not equal to certain numbers
Is there a way to shorten this if
statement? 有没有一种方法可以缩短此
if
语句?
if i != 9 or i != 23 or i != 25 or i != 33 or i !=35:
print(i)
how about 怎么样
if i not in [9,23,25,33,25]:
print(i)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.