- 博客(3)
- 收藏
- 关注
原创 关于类的tips
1、创建类时init函数是两个下划线2、访问属性和访问方法的exampleclass Restaurant(): def __init__(self,restaurant_name,cuisine_type): self.restaurant_name=restaurant_name self.cuisine_type=cuisine_type def de...
2018-03-18 11:12:10 250
原创 关于for循环处理列表的思考
1、在for循环中删除列表元素magicians=['jen','lexy','bob']for magician in magicians: print(magician) print(magicians[0]) del magicians[0] print(magician) print(magicians) print('\n') jen jen je...
2018-03-16 14:30:58 244
原创 将键值对当作实参传进函数
def build_profile(first,last,**user_info): profile={} profile['firstname']=first profile['lastname']=last for k,v in user_info.items(): profile[k]=v return profileuser_profile=bu...
2018-03-16 14:28:31 890
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人