A bug in the error message
this is my code for exercise 4.1: n = [3, 5, 7]
for i in range(0, 3): print n[i]
def print_list(x): for i in range(len(x)): print x[i]
and this is the error message: Oops, try again! The body of your function should not contain any references to ‘n’
But there is no reference to n in my code… how can I fix it?
I am not really sure why, but this code worked for me:
n = [3, 5, 7] def print_list(x): for i in range(0, len(x)): print x[i] print_list(n)
Unfortunately, it looks like there is a bug in this course that is causing a fair amount of confusion.
Popular free courses
Learn SQLLearn to communicate with databases using SQL, the standard data management language.Beginner friendly,4 LessonsLanguage Fluency
Learn HTMLStart at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency