What am I doing wrong here? List element modification



I keep get the following error message which stops me progressing to the next exercise:

Oops, try again.
Did you remember to multiply the second element in the list by 5?

However, on my printed screen I get 15 (which is correct - second element * 5) so my code is working. What have I done wrong?

n = [1, 3, 5]
# Do your multiplication here
n = n[1] * 5
print n


the output you should get:


the output you get:


you removed the whole list. You should update the second item, any idea how to achieve this? Ask if you need for more help, but first try to figure it out yourself. If you ask for more help, also be specific on what you don't understand


Oh I see! I didn't quite twig they wanted the whole list with the middle *5 I thought it wanted just the answer to n[1] * 5

So the code would be:

n = [1, 3, 5]

n[1] = n[1] * 5

Print n

It works now!

Thank you.

Output was [1, 15, 5]