I basically have to print true or false if the name 'Riley' is in my list... This is what I have:
if 'Riley' ??? names3:
return True
else:
return False
I basically have to print true or false if the name 'Riley' is in my list... This is what I have:
if 'Riley' ??? names3:
return True
else:
return False
Use the in
keyword.
>>> names = ['Will', 'Dodd', 'Harry']
>>> print 'Will' in names
True
>>> print 'Barry' in names
False