I am storing the result of a string in a variable and would like to know how to check if the string contains specific characters. I understand that the 'in' command can be used to check if a character/s is contained in a string "some string". My issue is I can't do this when the character/s are being evaluated against a variable.
Example:
s = ser.read(1000)
if "developer" in s:
print("True")
else:
print("False")
I'm getting an error
a bytes-like object is required, not 'str'
Could someone help with this?
Thanks.