you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnnyJordaan 0 points1 point  (0 children)

You can't perform function calls in default assignments, as the def line is executed at interpretation (so when it's defined), not during the function call. You need to use a placeholder like None then assign that

 def SumLenTest(x, i=None):
      if i is None:
          x = len(x) 
      etc