I'm currently working on a school assignment that involves me learning Python and I'm currently stuck on 'For Loops.' I'm stuck on understanding how they work and their syntax.
I have an example of code I've been trying to wrap my head around but just can't get it.
simple_list = ["Jack", "Dianne", "Alfred", "Erik"]
for x in simple_list:
print(x)
This is the code I've been focusing on and I don't understand why it prints a name from the simple list. I also want to know what 'in' does as I couldn't find anything online that helped me understand it.
Thanks!