我正在尝试实现以下逻辑:
bitmap_id = 'HelloWorld'
if 'SLIDE' not in bitmap_id and 'ICON' not in bitmap_id and 'BOT' not in bitmap_id:
print bitmap_id
如果bitmap_id是'ICON_helloworld',那么就不应该打印任何信息。我相信大家都会认为这太长了,而且看起来很难看,所以我试图像下面展示的那样做,但它没有起作用。
if any(s not in bitmap_id for s in ['SLIDE', 'ICON', 'BOT']):
print bitmap_id
我做错了什么?
for
循环吗? - Peut22