Question: Python Given a line of code, I want to take out a portion of the arithmetic and turn it into a global function, so that
Python
Given a line of code, I want to take out a portion of the arithmetic and turn it into a global function, so that I can consistently use the same global function later on.
Here's my code

I want to turn currentTotal into a global.
This is what I came up with in an attempt to make the global function, but it is not working properly. Can you please correct my error(s)?

= currentTotal = 0 for iCount in range(6): current Total += iCount print(currentTotal) 15 def addit(_num): currentTotal = 0 currentTotal += iCount for iCount in range(6): addit print(currentTotal)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
