fork download
  1. # your code goes here
  2. #Функція флатен
  3. #0JLQsNGB0LjQu9C10L3QutC+INCQ0YDRgtC10Lwg
  4. def Flatten(L):
  5. for val in L:
  6. if isinstance(val, list):
  7. Flatten(val)
  8. else:
  9. print(val)
  10. ar = [[3,2,1], 4, 5, [6, [7,8]], 9]
  11.  
  12. Flatten(ar)
Success #stdin #stdout 0.13s 14144KB
stdin
Standard input is empty
stdout
3
2
1
4
5
6
7
8
9