def get_exercises_from_topics(topicId_list):
 exs = []
 for topic in topicId_list:
  if topic:
   exercises = get_topic_contents(topic_id=topic, kinds=['Exercise'])[:5]
   for e in exercises:
    exs += [e['id']]
 return exs

def get_exercises_from_topics ( topicId_list ) : exs = [ ] for topic in topicId_list : if topic : exercises = get_topic_contents ( topic_id = topic , kinds = [ 'Exercise' ] ) [ : 5 ] for e in exercises : exs += [ e [ 'id' ] ] return exs
return an ordered list of the first 5 exercise ids under a given subtopic/topic .