babulasi

Results 3 comments of babulasi

local variable is referenced before assignment, maybe something like this is a solution? temperature=20 thermo=15 def increase_temp(): if temperature >= 15: global thermo thermo = temperature + 5 return thermo...

temperature=15 thermo=15 def increase_temp(): if temperature >= 15: thermo = temperature + 5 return thermo print(thermo) else: message = "Everything is OK" return message print(increase_temp()) ok, I didn't drink coffee...now,...

global variables can be used inside or outside of functions and stays global On Tue, 4 Feb 2020, 15:58 vishalrao009, wrote: > Yeah, that works too. > Is it that...