Python Getting Different Results While Executing Similar For Loops

Python Getting Different Results While Executing Similar For Loops