Python 19 Programming Tutorial - My trip to Walmart and Sets

Bucky Roberts · August 29, 2014 


groceries = {'cereal', 'milk', 'starcrunch', 'beer', 'duct tape', 'lotion', 'beer'}
print(groceries)

if 'milk' in groceries:
    print("You already have milk hoss!")
else:
    print("Oh yea, you need milk!")

你可能感兴趣的:(Python 19 Programming Tutorial - My trip to Walmart and Sets)