global r
global t
def divide(a,b):
try:
c=a/b
print(c)
return c
except:
b+=1000
r=b
raise Exception
def main():
try:
r=0
t=1000
divide(t,r)
except:
print('except block')
divide(t,r)
main()
How do i change the value of the variable r and then call the function again from the except block, after catching it as an exception?