Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # list_differences.py
- color_list1 = ["red","green","blue","purple","yellow","violet","white","cyan",
- "magenta","turquoise","black","lightblue","grey","lightgrey","darkgrey",
- "lightgreen","teal","pink","darkblue","darkred","darkgreen","orchid","beige"]
- color_list2 = ["red","green","blue","purple","yellow","orchid","grey","white",
- "cyan","turquoise","limegreen","lightblue","lightgrey","darkgrey","violet",
- "lightgreen","tan","darkblue","darkred","darkgreen","pink"]
- print "color_list1 =", color_list1
- print "-"*70 # 70 dashes
- print "color_list2 =", color_list2
- print "-"*70
- # convert lists to sets
- color_set1 = set(color_list1)
- color_set2 = set(color_list2)
- print "These are the colors of color_list1 that are not in color_list2:"
- print color_set1 - color_set2
- print "-"*70
- print "These are the colors of color_list2 that are not in color_list1:"
- print color_set2 - color_set1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement