Code Room
Code reviewMedium
Question
Review this Python function that finds tags shared between two feeds.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
def common_tags(posts_a, posts_b): # posts_a, posts_b: lists of Post objects, each with a .tag string common = [] for a in posts_a: for b in posts_b: if a.tag == b.tag and a.tag not in common: common.append(a.tag) return common def report(feed_a, feed_b): shared = common_tags(feed_a, feed_b) return f"{len(shared)} shared tags: {', '.join(shared)}"Run or narrate your approach, then ask the coach.