Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FirstStudentFirstGroup = input().split()
- SecondStudentFirstGroup = input().split()
- FirstStudentSecondGroup = input().split()
- SecondStudentSecondGroup = input().split()
- FirstStudentFirstGroup.sort()
- FirstStudentSecondGroup.sort()
- SecondStudentFirstGroup.sort()
- SecondStudentSecondGroup.sort()
- d = {}
- for i in range(max(len(FirstStudentFirstGroup), len(SecondStudentFirstGroup))):
- if i < len(FirstStudentFirstGroup) and i < len(SecondStudentFirstGroup):
- if FirstStudentFirstGroup[i] == SecondStudentFirstGroup[i]:
- d[FirstStudentFirstGroup[i]] = 1
- for i in range(max(len(FirstStudentSecondGroup), len(SecondStudentSecondGroup))):
- if i < len(FirstStudentSecondGroup) and i < len(SecondStudentSecondGroup):
- if FirstStudentSecondGroup[i] == SecondStudentSecondGroup[i]:
- d[FirstStudentSecondGroup[i]] = 1
- print(list(d.keys()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement