954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

return array [newbie question]

Hi, I am new to python (in fact this is my 2nd day learning it)

I was given code that resembles:

if xyz
                  #do abc
                  return x

              else
                  return y

        return[]

What does the return[] do? Sorry if this is a stupid question.;)

caranjo
Newbie Poster
2 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

[] means an empty list in python.

ghostdog74
Junior Poster
156 posts since Apr 2006
Reputation Points: 75
Solved Threads: 44
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You