开发者社区 问答 正文

Python中如何设置对象的属性呀?

Python中如何设置对象的属性呀?

展开
收起
游客toxlrfghuoiyc 2021-11-02 19:44:09 639 分享 版权
1 条回答
写回答
取消 提交回答
  • setattr(Parent,'x',3)print(getattr(Parent,'x'))

    2021-11-02 19:44:28
    赞同 展开评论