Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def softuni_students(*args, **kwargs):
- result = []
- invalid_courses = []
- for course_id, username in sorted(args, key=lambda item: item[1]):
- if course_id in kwargs:
- course = kwargs[course_id]
- result.append(f"*** A student with the username {username} has successfully finished the course {course}!")
- else:
- invalid_courses.append(username)
- if invalid_courses:
- result.append(f"!!! Invalid course students: {', '.join(sorted(invalid_courses))}")
- return "\n".join(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement