Using for loop


#1

python for loop

This section of code prints “Columbus” 5 times, (if is use print abc, it would print the entire list). Basically if the variable miss-match but the first character is correct, the last element is repeated, why?

names = ["Adam","Alex","Mariah","Martine","Columbus"]
for abc in names:
  print ab

Thanks
Ahsan


#2

there should be an error, given ab variable is unnamed:

image