def func(x,y):
    mysum = x+y
    return mysum

func.name = 'apollo'
print(func.name)
# apollo

# print(func.age) # 不挂载,获取会报错
# AttributeError: 'function' object has no attribute 'age' 

 

相关文章:

  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-01-10
  • 2021-10-30
  • 2021-06-24
  • 2021-12-05
  • 2021-11-25
相关资源
相似解决方案