t300.py 452 B

12345678910111213141516171819202122232425262728293031
  1. # Test the comparison of sets
  2. l = [1,2,3,4,1,1]
  3. print l
  4. s = set(l)
  5. print s
  6. print '# equal'
  7. eq = set(l)
  8. print eq
  9. print '# forwards'
  10. print s.isdisjoint(eq)
  11. print s > eq
  12. print s.issuperset(eq)
  13. print s >= eq
  14. print s == eq
  15. print s != eq
  16. print s.issubset(eq)
  17. print s <= eq
  18. print s < eq
  19. print '# backwards'
  20. print eq.isdisjoint(s)
  21. print eq > s
  22. print eq.issuperset(s)
  23. print eq >= s
  24. print eq == s
  25. print eq != s
  26. print eq.issubset(s)
  27. print eq <= s
  28. print eq < s