My code cant be wrong, BUT? (10/18)


#1

https://www.codecademy.com/courses/learn-python/lessons/lists-and-functions/exercises/modifying-an-element-of-a-list-in-a-function?action=lesson_resume&link_content_target=interstitial_undefined

My error code is:
list_function([0, 3]) returned [3, 8, 7] instead of [0, 6]

Even though when I add:
"
print list_function([0, 3])
"
IT DOES PRINT [0, 6]!!!

My code looks like this:



def list_function(x):
      x[1] = x[1] + 3
      return x

n = [3, 5, 7]
print list_function(n)
print list_function([0, 3])


#2

Hi @scriptrunner43025,

In case there is a bug in the system, refresh the page and submit the code again. Let us know what happens.

You can also try moving this statement to the beginning of the code …

n = [3, 5, 7]

#3

Thank you,

It worked the following day, so I progressed.
When I go back now it still doesn’t work though.
Thank you for your concern


#4

Are you getting a message from Codecademy stating that is doesn’t work, or are you getting unexpected output, or both?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.