Question: using rebrickable API, Retrieving Parts for Lego Sets.For each set returned inparta,use the API to get a list of all inventory parts in that set.Since

using rebrickable API,

Retrieving Parts for Lego Sets.For each set returned inparta,use the API to get a list of all inventory parts in that set.Since we are only interested in the parts that are used most frequently in a set, attempt to retrieve up to but no more than the top 20 parts for each set.For each part,you will need its:

  • part color
  • part quantity
  • part name
  • part number

To address the fact that some parts for a set have the same part_num, construct a unique id by concatenating the part number and color.e.g.,A part having a part_num = "3203" and a color "C9C9C9" would be concatenated into an id = "3203_C9C9C9".You will use this part id as the node id when you add it to the graph in part c.

I think we should use dictionaries and looping, but not sure how to.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!