students_period_A = ["Alex", "Briana", "Cheri", "Daniele"] students_period_B = ["Dora", "Minerva", "Alexa", "Obie"] # method 1, problematic for students in students_period_A: students_period_B.append(students) print(students_period_B) # method 2, more elegant all_students = students_period_A + students_period_B for student in all_students: print(student) print(all_students) # output ['Dora', 'Minerva', 'Alexa', 'Obie', 'Alex'] ['Dora', 'Minerva', 'Alexa', 'Obie', 'Alex', 'Briana'] ['Dora', 'Minerva', 'Alexa', 'Obie', 'Alex', 'Briana', 'Cheri'] ['Dora', 'Minerva', 'Alexa', 'Obie', 'Alex', 'Briana', 'Cheri', 'Daniele'] Alex Briana Cheri Daniele Dora Minerva Alexa Obie Alex Briana Cheri Daniele ['Alex', 'Briana', 'Cheri', 'Daniele', 'Dora', 'Minerva', 'Alexa', 'Obie', 'Alex', 'Briana', 'Cheri', 'Daniele']
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter