Reply To: I need to get a True or False if a variable contains a string match

Welcome to Python Land Forums The Python Tutorial I need to get a True or False if a variable contains a string match Reply To: I need to get a True or False if a variable contains a string match

#2314
Erik van Baaren
Keymaster

So you want something like this, I think:

import sys
import os

i =  (“D90”)
print(i)

if i == (“D90”):
    # it's true, so set led
else:
    # it's false, set other led