Jul-03-2020, 11:29 AM
My compliments DeaD_EyE, your answers are always very informative. But it is not what Drone asks.
Drone4four, I do not understand your question. You can, also in Jupyter, fill in your code and save it? You must have learned how to define a function? The result should be something like:
(Jul-03-2020, 09:01 AM)Drone4four Wrote: My problem is how to reformat those operations into a function inside an actual script to automate that output. I’m completely lost trying to do that.
Drone4four, I do not understand your question. You can, also in Jupyter, fill in your code and save it? You must have learned how to define a function? The result should be something like:
from collections import namedtuple BeltStats = namedtuple('BeltStats', 'score ninjas') ninja_belts = {'yellow': BeltStats(50, 11), 'orange': BeltStats(100, 7), 'green': BeltStats(175, 1), 'blue': BeltStats(250, 5)} def add_stats(some_dict): test=0 "add your code here "also study Dead_eye's advice return test print(add_stats(ninja_belts))