Why does this python code have a syntax error?

后端 未结 3 566
说谎
说谎 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 02:14

    In Python 2 print is a reserved word and cannot be the name of a variable or method or function.

提交回复
热议问题