📜  私有类方法python代码示例

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

代码示例1
class Student:
  def __init__(self):
    pass
  
  
  # The double underscore in the front makes it private
  def __print_name(self):
    return print("private")
  
  
  # proof of use
  def print_name(self):
    return print("public")