Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. meskie = list()
  2. zenskie = list()
  3. k = {'Kosma', 'Barnaba', 'Bonawentura', 'Jarema', 'Kuba'}
  4. licznik = 0
  5. while licznik < 6:
  6. x = str(input('Podaj imie: '))
  7. if x.isalpha()&x.endswith('a'):
  8. temp = {x.title()}
  9. porownaj = len(temp.intersection(zenskie))
  10. por = len(k.intersection(zenskie))
  11. if (porownaj == 0)&(por == 0):
  12.  
  13. zenskie += [x.title()]
  14. licznik += 1
  15. else:
  16. meskie += [x.title()]
  17. licznik += 1
  18. else:
  19. meskie += [x.title()]
  20. licznik += 1
  21.  
  22. zenskie.sort(key=str.lower)
  23. meskie.sort(key=str.lower)
  24. print(meskie,zenskie)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement