Jump to content

Python Tuple an Methode übergeben


Recommended Posts

Nochmals eine Frage:

Kann man in Python 3 die Bedingungen gleicher Logik z.B != mit mehreren Variablen vergleichen, also in einer Kurzform anstatt diverse "nicht gleich" hintereinander zu schreiben. So das self.sw.get_color() nur einmal aufzuführen ist. "and self.sw.get_color() != [red, green...." geht eben nicht.

if self.ping(self.HOST_Controller) == False and self.sw.get_color() != [red, green, purple]
elif self.ping(self.HOST_Controller) == True and self.sw.get_color() != red and self.sw.get_color() != green and self.sw.get_color() != purple:


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...