Variables not working in functions, why? What's wrong in My Code? I checked many times but everything is current. Please Help 🥺
Mode = "Copy"
#mode
def runRclone():
if Mode == "Copy":
print ("cpy")
modeFinal = "copy"
elif Mode == "Move":
modeFinal = "move"
elif Mode == "Check Size":
modeFinal = "size"
else:
modeFinal = "size"
print("Some Thing is Wrong, Contact me!")
runRclone()
print(modeFinal)
Output
cpy
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-7ade1dfbd321> in <module>()
42 runRclone()
43
---> 44 print(modeFinal)
NameError: name 'modeFinal' is not defined