📜  让我们在 greeting 方法中添加一个文档字符串.怎么样,“输出带有人名的消息”. - Python 代码示例

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

代码示例1
#Let’s add a docstring to the greeting method. How about, “Outputs a message with the name of the person”
  class Person:
  def __init__(self, name):
    self.name = name
  def greeting(self):
    ___
    print("Hello! My name is {name}.".format(name=self.name)) 

help(___)