Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- students_info = []
- searched_course = ""
- while True:
- info = input()
- if ":" not in info:
- searched_course = info
- break
- data = info.split(":")
- name, id_, course = data[0], int(data[1]), data[2]
- students_info.append({"name": name, "id": id_, "course": course})
- for student in students_info:
- if searched_course.startswith(student["course"][0:2]):
- print(f"{student['name']} - {student['id']}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement