“Write a function ten_times_each() that is very much like double(), but instead of returning a new sequence with double each element in the original one, it returns a new sequence with ten times of each element in the original one.”
def ten_times_each(sequence):
result = []
for element in sequence:
result = result + [element * 10]
return result
ten_times_each(2, 90, 3, 13.5)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/ipykernel_7890/597525241.py in <module> ----> 1 ten_times_each(2, 90, 3, 13.5) TypeError: ten_times_each() takes 1 positional argument but 4 were given
ten_times_each([2, 90, 3, 13.5])
[20, 900, 30, 135.0]