The following code is supposed to take two lists of strings, the lists having the same length, and concatenate corresponding entries in the list. For example, it should take the first entries from each list, "Homer" and "Simpson", and concatenate them to produce "Homer Simpson", and so on for the next entries.
first_name = ['Homer', 'Marge', 'Bart', 'Lisa']
last_name = ['Simpson', 'Carlson', 'Flanders', 'Gamble']
for i in range(len(first_name)):
for n in range(len(last_name)):
print(first_name[i] + " " + last_name[n])
Expected Result:
Homer Simpson
Marge Carlson
Bart Flanders
Lisa Gamble
Actual Result:
Homer Simpson
Homer Carlson
Homer Flanders
Homer Gamble
Marge Simpson
Marge Carlson
Marge Flanders
Marge Gamble
Bart Simpson
Bart Carlson
Bart Flanders
Bart Gamble
Lisa Simpson
Lisa Carlson
Lisa Flanders
Lisa Gamble