Passing a list into the function


Replace this line with your code.



Please post your question and your code so we can suitably help you :slight_smile:


When i am trying to run this code in python shell 3.5 it says syntax error

def list_function(n):
	return n

SyntaxError: invalid syntax


I will need a bit more info. What exactly are you trying to do and in relationship to what exercise?


this exercise was "passing a list into the function" it ran into codeacademy well but when I am trying to run in python shell it is not running

Thanks in advance NIK :slight_smile:


Is that your full code. I'm guessing that you probably have a print somewhere, whose syntax is a bit different in python 2.x vs in python 3.x:

Python 2.X

print 'something'

Python 3.X



ya mine is 3.5 ,ya that was my full code,it was same as in the exercise in "Passing a list into the function"

this is mine

def list_function(n):
	return n

after entering the list it tells "syntax error"


Can you post a printscreen, because nothing's wrong with your code?