-4
For ex if a is my global var:
a = 0
def func1():
    #something happens
    a += 1
return a
(repeats 2 more times)

def func2():
      if a == 3:
    #do something

Would this work? I apologize if this is unclear, as I am very new to Python.

SNAFU
  • 3
  • 1

1 Answers1

0

This is the return doing, use return to reuse a result.

a = 0
def add1(a):
   a += 1
   return a
a = add1(a)

def func1(num):
    if num == 3:
        ...

func1(a)
Cvanzy
  • 382
  • 3
  • 11