Consider a list I want to parse using a for :
for
friends = [\"Joe\", \"Zoe\", \"Brad\", \"Angelina\", \"Zuki\", \"Thandi\", \"Paris\"] for i in fri
var = '' friends = ["Joe", "Zoe", "Brad", "Angelina", "Zuki", "Thandi", "Paris"] for i in friends: var=i
if list and loop are in function then declare var as global
global var
in starting of function