Courseiva

PCEP

Study mode — explanations shown

1

Control Flow, Loops, Lists and Logic

hard

Refer to the exhibit. What is the output of the code?

Exhibit

>>> data = [10, 20, 30, 40, 50]
>>> result = []
>>> for val in data:
...     if val > 25:
...         result.append(val * 2)
...     elif val < 15:
...         result.append(val + 5)
...     else:
...         result.append(val)
>>> print(result)
0 of 30 answered