📌  相关文章
📜  class dog_years: years = 0 __ fido=Dog() fido.years=3 print(fido.dog_years()) - Python 代码示例

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

代码示例1
#Create a Dog class with dog_years based on the Piglet class shown before (one human year is about 7 dog years).
class dog_years:
  years = 0
  __
    
fido=Dog()
fido.years=3
print(fido.dog_years())