pyyhon内的hasattr函数

hasattr函数:用来判断某对象内是否包含某属性
hasattr(obj,name)
obj---实例对象
name---属性

posted @ 2020-08-09 10:21  小酷蛙  阅读(162)  评论(0)    收藏  举报