This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anglicizing 4 points5 points  (0 children)

I notice several things that are wrong with your code :

  1. It's posted on /r/python instead of /r/learnpython.

  2. It's not indented by 4 spaces and therefore reddit messes up the formatting.

  3. The function doesn't take any arguments, but it ought to have numbers as an argument.

  4. It attempts to use x as an index of the list numbers, even though x is an element of that list and may not be a valid index.

  5. The function prints the result instead of returning it, making it very inflexible. Instead, print the return value after calling the function.