Skip to content Skip to sidebar Skip to footer

Python Issue Value Of Property Changes When Falling Out Of Loop Scope

I am having trouble with a python class i wrote, the particular problem is in the parseData() function. at the end of the function i have commented where the problem is. The probl

Solution 1:

This is happening because you only ever create a single instance of the WeatherData class, so you just keep updating that same one over and over again.

You just need to move the line newWeatherData = WeatherData() inside of your first for loop.

Post a Comment for "Python Issue Value Of Property Changes When Falling Out Of Loop Scope"