Question from the Python - Fundamentals test

Write a Python function that prints the elements of a list.

Expert

What is the output of the following code ?

def f(l):
	for element in l:
		print(element, end=" ")
	else:
		print("\nOops, something went wrong...")

f(list())
f([x for x in range(3)])
Author: ThéoStatus: PublishedQuestion passed 1592 times
Edit
15
Community EvaluationsNo one has reviewed this question yet, be the first!