Why does this python code have a syntax error?

后端 未结 3 563
说谎
说谎 2020-12-12 01:39

To practice python, I made a simple class for a tree structure in which each node can have infinite child nodes.

class Tree():

  def __init__(self, children         


        
3条回答
  •  情歌与酒
    2020-12-12 01:58

    In Python 2 print is a keyword, so you can't use it as the name of a function or method.

提交回复
热议问题