Exercise 4: Fix the Crashes — Possible Solution ==================================================================== colours = ["red", "green", "blue"] ids = [101, 102, 103] # print(colours.join(", ")) # AttributeError: a list has no join method. join belongs to the # separator string, not to the list. print(", ".join(colours)) # print(", ".join(ids)) # TypeError: join only accepts strings and these are ints. print(", ".join(map(str, ids))) # fix 1: convert, then join print(*ids, sep=", ") # fix 2: no join, print converts Output: red, green, blue 101, 102, 103 101, 102, 103 WHY THIS WORKS AS AN ANSWER ------------------------------ The first line is a JavaScript habit: arrays have a join method but Python lists do not, because in Python join lives on the separator string, so the error is AttributeError. The second is TypeError because join refuses anything that is not already a string, where JavaScript would convert silently. Converting first with map(str, ...) keeps join, while print(*ids, sep=', ') avoids join entirely because print() converts for you.