How to iterate through a dictionary to get values on the lowest level?

Advertisements Please help me understand how to extract the value of each ingredient for each product and do something with it. But for starters I just want to print them all one by one. MENU = { "product_1": { "ingredients": { "ingredient_1": 50, "ingredient_2": 18 }, "cost": 1.5 }, "product_2": { "ingredients": { "ingredient_1": 200,… Read More How to iterate through a dictionary to get values on the lowest level?

How can I put the elements in the list next to the print out of the dictionary values?

Advertisements DESIRED OUTPUT: Proportion of 1- letter words: 4.76% (1231 words) Proportion of 2- letter words: 16.14% (4177 words) Proportion of 3- letter words: 20.33% (5261 words) Proportion of 4- letter words: 24.33% (6295 words) Proportion of 5- letter words: 15.03% (3889 words) Proportion of 6- letter words: 7.91% (2048 words) Proportion of 7- letter… Read More How can I put the elements in the list next to the print out of the dictionary values?

how to get all objects between two column from a javascript array

Advertisements I have this sample array. [ { __EMPTY: ‘POS:’, __EMPTY_1: ‘LOUN – LOUNGE’, }, { __EMPTY: 44946, __EMPTY_1: ‘LB015260′, __EMPTY_2: ’15:04’, __EMPTY_3: ‘L-15’, __EMPTY_4: 1402, __EMPTY_5: ‘AKASH’, __EMPTY_6: 66.78, __EMPTY_7: 0, }, { __EMPTY: 44946, __EMPTY_1: ‘LB015260′, __EMPTY_2: ’15:04’, __EMPTY_3: ‘L-15’, __EMPTY_4: 1402, __EMPTY_5: ‘AKASH’, __EMPTY_6: 66.78, __EMPTY_7: 0, }, { __EMPTY: 44946, __EMPTY_1:… Read More how to get all objects between two column from a javascript array

Iterating through a dictionary to get next values from previous values

Advertisements I have this sample dataset {‘data1’:200, ‘data2’:500} I want to iterate this data in a range of 25, such that each iteration would give me the previous value * (1+0.05) within the iteration. In this case the output of range of 2 would look like this: {‘data1’:[200,210], ‘data2’:[500, 525]} Anyone has an idea of… Read More Iterating through a dictionary to get next values from previous values

Select certain elements from a list with a loop and condition

Advertisements I have a list similar to this one below, but much larger. mylist = [‘ 12345678912 ST’, ‘ Halterung für Fortlüfterhaube’, ‘ Material/Werkstoff: Metall-Lackiert’, ‘ **Beginn Zeichnung**’, ‘ 98765432164 ST’, ‘ Klappe, komplett’, ‘ **Beginn Zeichnung**’, ‘ 74563254671 ST’, ‘ Sieb Außen-Dm 145 x 0,8mm’, ‘ Versatz Dm 122 x 5mm tief’, ‘ Material:… Read More Select certain elements from a list with a loop and condition