ddx = []
def AGMA(): #anion gap metabolic acidosis
ddx = ["Methanol", "Uremia", "Diabetic Ketoacidosis", "Paraldehyde", "Iron tablets", "Isoniazid", "Lactic acidosis", "Ethanol", "Salicylates (aspirin) - Late"]
return ddx
print(ddx)
print(ddx) is just returning [] still
How do I get my function to actually change to the array I want?
ddx = AGMA()
– esqew Oct 20 '20 at 14:49ddx
inside the function is a local variable and as nothing to do with the global one with the same name. You should pass it as an argument toAGMA()
. isntead. – martineau Oct 20 '20 at 15:19