Advertisement
Guest User

newg

a guest
Dec 11th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. n = int(input("insert a number: "))
  2. boy_list=[]
  3. girl_list=[]
  4. count1=0
  5. count2=0
  6. good=0
  7. bad=0
  8. for i in range(n):
  9. a=input("enter name and year").lower() + " "
  10. if "mr" in a[:2]:
  11. b=''.join(i for i in a if i.isdigit())
  12. boy_list.append(b)
  13. else:
  14. b = ''.join(i for i in a if i.isdigit())
  15. girl_list.append(b)
  16. for i in boy_list:
  17. for j in boy_list:
  18. if i==j:
  19. count1+=1
  20. for k in girl_list:
  21. if k==i:
  22. count2+=1
  23. girl_list.remove(k)
  24. if (count1==count2):
  25. good+=1
  26. if count1==0 or count2==0 or count1!=count2:
  27. bad+=1
  28. count1= 0
  29. count2= 0
  30. count3 = 0
  31. for k in girl_list:
  32. if k!=(""):
  33. count3+=1
  34. bad+=count3
  35. print (girl_list)
  36. print (boy_list)
  37. print (good)
  38. print (bad)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement