I have defined a variable on initialization, now if I`m trying to change the value it does not change.
File=""
def pathValue():
if File:
print("file path: " + File)
else:
File = "abc.txt"
print("file path: " + File)
pathValue()
Above is my sample code. It should change the value of the 'File' variable to 'abc.txt' but it's not working. Instead, it shows like this,
file path:
if the variable is empty then how can it bypass the if-condition?