Can’t access variable outside for loop

Can’t access variable outside for loop