Skip to content

Instantly share code, notes, and snippets.

@Caleb2501
Created May 5, 2013 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Caleb2501/5522224 to your computer and use it in GitHub Desktop.
Save Caleb2501/5522224 to your computer and use it in GitHub Desktop.
This one was too easy. Although, I am kind of glad after that last one!
#Write a program that will compare two lists,
# and append any elements in the second list that doesn't exist in the first.
# this was ridiculously easy.
list1 = ['caw', 'tweet', 'chirp', 'quack']
list2 = ['tweet', 'chirp', 'hoo', 'cheep']
for s in list1:
if s not in list2:
list2.append(s)
print "Here is a full list of bird calls that I know:"
print list2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment