I am working on an assignment for one of my classes at school where I need to concatenate two lists together. I am using the code:
flowers = ["rose", "bougainvillea", "yukka", "marigold", "daylily", "lily of the valley"]
thorny = flowers[0:3]
poisonous = flowers[-1]
dangerous = flowers[0:3] + flowers[-1]
I keep getting the error message:
dangerous = list(set(flowers[0:3] + flowers[-1]))
TypeError: can only concatenate list (not "str") to list
I was wondering why this doesn't work. Thanks!
dangerous = flowers[0:3] + flowers[-1:]