Skip to content

Instantly share code, notes, and snippets.

@michaeltennant4554
Created December 11, 2016 18:53
Show Gist options
  • Save michaeltennant4554/5b58b4be4881b32a6e7fa8b4038b4b21 to your computer and use it in GitHub Desktop.
Save michaeltennant4554/5b58b4be4881b32a6e7fa8b4038b4b21 to your computer and use it in GitHub Desktop.
bag = ["chicken" , "Tom hanks" , "christmas cake"]
for item in bag: #this will make a item go each time
print(item) #this will make the item print on the list
#now heres a more advanced loop :8
bag = ["chicken" , "Tom hanks" , "christmas cake"]
for item in bag: #starts to look through the bag for the item u want
if item == "chicken": #checks if item is in the bag
print("dammmmm thats some nice chicken")
else:
print("hmmmmmmm thats noT CHICKEN")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment