Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input("insert a number: "))
- boy_list=[]
- girl_list=[]
- count1=0
- count2=0
- good=0
- bad=0
- for i in range(n):
- a=input("enter name and year").lower() + " "
- if "mr" in a[:2]:
- b=''.join(i for i in a if i.isdigit())
- boy_list.append(b)
- else:
- b = ''.join(i for i in a if i.isdigit())
- girl_list.append(b)
- for i in boy_list:
- for j in boy_list:
- if i==j:
- count1+=1
- for k in girl_list:
- if k==i:
- count2+=1
- girl_list.remove(k)
- if (count1==count2):
- good+=1
- if count1==0 or count2==0 or count1!=count2:
- bad+=1
- count1= 0
- count2= 0
- count3 = 0
- for k in girl_list:
- if k!=(""):
- count3+=1
- bad+=count3
- print (girl_list)
- print (boy_list)
- print (good)
- print (bad)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement