if文で条件を何度も繰り返さないようにする良い方法はありますか?Pythonでif文を何度も繰り返すのを避ける方法は?
for entity in entities:
if (entity.entity_id.startswith('sensor') and "sourcenodeid" not in entity.entity_id and "interval" not in entity.entity_id and "previous" not in entity.entity_id and "exporting" not in entity.entity_id and "management" not in entity.entity_id and "yr" not in entity.entity_id and "alarm" not in entity.entity_id):
data = remote.get_state(api, entity.entity_id)
#print(data)
私はor
と試みたが、私は、データに格納すべきではない状態で実体を得たので、それが正しく動作しません。
ありがとうございました。すべてのジェネレータの表現は毎回宝くじより良いです – AhmyOhlin