Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
What code needs to be added to line 6 so that this program prints out ['tulips!', 'bluebells!', 'foxglove!', 'peonies!']
['tulips!', 'bluebells!', 'foxglove!', 'peonies!']
def spring_time(my_list): spring_list = [] for flower in my_list: flower = flower + "!" spring_list.append(flower) # what code goes here? flowers = ["tulips", "bluebells", "foxglove", "peonies"] flowers = spring_time(flowers) print(flowers)
return my_list
return spring_list
return flowers
return spring_time