3

I have some Python code that takes user input for mass and diameter of an object. Those data parameters I later use in a calculation formula. Instead of having the user input those two values, I now have a dictionary that stores the values. How can I now have those values extracted from the dictionary and placed into the calculation formula? I'm very new to Python and trying to figure out if this done via a while loop or defining an function within a while loop, etc.

Thanks.

Iridium
  • 31
  • 1
  • 1
    Please [edit] and share the code, we can do nothing just reading you ;) – azro Sep 21 '22 at 16:43
  • Hint 1: use a for loop on the elements of the dictionary. Hint 2: spend some time watching/reading a tutorial. –  Sep 21 '22 at 16:44
  • Use `dictionary[key]` to get the value of a dictionary element. Then you use it the same way you use the user input. – Barmar Sep 21 '22 at 16:46

0 Answers0