Advertisement
molendzik

Sety - Zadanie 1

Dec 2nd, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1. import random
  2. temp0 = []
  3. temp1 = []
  4. temp2 = []
  5. temp3 = []
  6. druzyny = ["Manchester City", "Manchester United", "Arsenal London", "Chelsea London", "Carlisle United", "Burnley FC", "PSG", "Olimpique Lyon", "AS Monaco", "AJ Auxerre", "Le Havre", "Real Madryt", "FC Barcelona", "Deportivo Alaves", "Cartagena CF", "AZ Alkmaar", "Ajax Amsterdam", "Borussia Dortmund", "Bayern Monachium", "FC Aue", "Union Berlin", "Śląsk Wrocław", "Ruch Chorzów", "Legia Warszawa", "Lech Poznań", "Pogoń Szczecin", "FC Porto", "Benfica Lizbona", "Zenit Petersburg", "Fenerbahce"]
  7.  
  8. while len(temp0) < 10:
  9.   y = random.choice(druzyny)
  10.   temp0.append(y)
  11. while len(temp1) < 10:
  12.   y = random.choice(druzyny)
  13.   temp1.append(y)
  14. while len(temp2) < 10:
  15.   y = random.choice(druzyny)
  16.   temp2.append(y)
  17. while len(temp3) < 10:
  18.   y = random.choice(druzyny)
  19.   temp3.append(y)
  20.  
  21. set0 = set(temp0)
  22. set1 = set(temp1)
  23. set2 = set(temp2)
  24. set3 = set(temp3)
  25.  
  26. print (set0.intersection(set1))
  27. print (set2.difference(set3))
  28. print (set1.union(set2))
  29. print (set3.issubset(set0))
  30. print (set0.issuperset(set3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement