Advertisement
Guest User

Wrong indentation?

a guest
Nov 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. def gendat(x):
  2.     if isinstance(x, int):
  3.         return [x]
  4.     elif len(x)==0:
  5.         return []
  6.     else:
  7.         list y = []
  8.         for n in x:
  9.             y.extend(gendat(n))
  10.         return y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement