多层嵌套List输出

#!/usr/bin/python

movie = ["The Holy Grail",1975,"Terry Jones & Terry Gilliam",91,["Graham Chapman","Michael Palin",["John Cleese","Terry Gilliam"]]]

def printlist(m):
  for mi in m:
    if(isinstance(mi,list)):
      printlist(mi)
    else:
      print(mi)

printlist(movie)

你可能感兴趣的:(多层嵌套List输出)