Sorry, I have two questions - this one is about the exercise itself.
While the suggested solution code achieves what is asked, to me it prints the incorrect value:
students_period_A = ["Alex", "Briana", "Cheri", "Daniele"]
students_period_B = ["Dora", "Minerva", "Alexa", "Obie"]
for student in students_period_A:
students_period_B.append(student)
print(student)
As student
equals the value of the current iteration number, and it prints this every time the loop is run, what is printed is simply the list of values in students_period_A
.
Would it be more correct to write the following?
students_period_A = ["Alex", "Briana", "Cheri", "Daniele"]
students_period_B = ["Dora", "Minerva", "Alexa", "Obie"]
for student in students_period_A:
students_period_B.append(student)
print(students_period_B)
Now we only print the output of the variable we’re adding to after the loop is done iterating each appended value.
I know this is a tiny difference but it helps to check my intuitions here to see if this is a minor mistake in the format or if I’m misunderstanding things!