0

I am trying to write a simple function to check if both of the list hold the same items, even if they are not in the same order. For example:

list1 = ("a","b","c","d","e","f")

list2 = ("f","c","b","d","e","a")

if list2 == list 1 (in any order):
   print("list 1 and list 2 are similar.")

else:
    print("list 1 and list 2 are different")

I am trying to find out if list 2 and list 1 both hold the same items.

  • What about the repeated elements if there are any? I mean, what should be the result for `("a", "a", "b") and ("b", "a")`? – thefourtheye Dec 24 '15 at 11:20
  • I have changed the question. –  Dec 24 '15 at 11:21
  • And didn't you ask this [yesterday](http://stackoverflow.com/q/34438949/3001761)? – jonrsharpe Dec 24 '15 at 11:22
  • I also provided example code. –  Dec 24 '15 at 11:24
  • You provided *psuedo*code - this is neither a code-writing nor tutorial service, some actual effort is expected. – jonrsharpe Dec 24 '15 at 11:25
  • @jonrsharpe, what is pseudocode and I have tried to provide some of my own knowledge. I would provide better code but I am new to python and have only had it for two weeks –  Dec 24 '15 at 11:27
  • 1
    *"what is pseudocode"* - like your main question, you should consider Googling it before asking. – jonrsharpe Dec 24 '15 at 11:31
  • I googled it and I realised that other people do pseudocode kind of like the duplicate of this question. –  Dec 24 '15 at 12:03

0 Answers0