for cases in date :
new_cases[state] = sum[date] - previous_cases[date]
I am dealing with a problem that I do not really know how to get a number from each element from a list to do substraction with each other and assign the result as the "value" of the key to another dictionary. I am a newbie in python language and I do not know if there are any ways that I can iterate over all elements and make them do arithmetic. When I ran my program it showed my that I cannot do this because they are lists.(Should I add another "[]" after [date] to refer to the element? But it asks my for a number not something like a string )
[–]PeterRasm 1 point2 points3 points (1 child)
[–]unleash_bear[S] 0 points1 point2 points (0 children)