📜  如何在python代码示例中定义一个类

📅  最后修改于: 2022-03-11 14:45:40.335000             🧑  作者: Mango

代码示例6
class Foo:
  def __init__(self):
    self.definition = Foo!
  def hi():
    # Some other code here :)
    
# Classes require an __init__ if you want to assign attributes. (self) defines what describes the attribs.