I'm still a beginner at learning Python. I want to ask something about loops. I found a written code like this:
user_ids = [u for u, c in user_ids_count.most_common(n)]
movie_ids = [m for m, c in movie_ids_count.most_common(m)]
how to read this code? I know that user_ids
is the object and user_ids_count.most_common()
is the function/method (please correct me if I'm wrong), but I have no idea what the logic sense of u for u, c
and what does that mean because I can't find any loops example that's written like this.