Reputation: 25
count = 0
def lol(count):
x = count + 1
print(x)
Currently i am calling this function within another file in my python program, and count is = 1 everytime it is ran, im unsure why, im trying to make it +1 after every time it is ran.
Any help would be greatly appriciated.
Upvotes: 0
Views: 470
Reputation: 191691
You are never modifying count
, and only printing the result of x = 0 + 1
This would do what you want, however, you should re-consider your need for global variables
count = 0
def lol():
global count
count += 1
print(count)
Upvotes: 1