I have a list called bag. I want to be able to check if only a particular item is in it.
bag = ["drink"]
if only "drink" in bag:
print 'There is only a drink in the bag'
else:
print 'There is something else other than a drink in the bag'
Of course, where I put 'only' in the code there, it is wrong. Is there any simple replacement of that? I have tried a few similar words.