摘要: # 类到对象:把对象共同的特征拿出来# class Garen:# camp='Demacia'# def attack(self):# print('attack')# 使用类# 1、实例化# 两个结果都是带class# print(Garen)# print(int)# # int这个函数怎么用 阅读全文
posted @ 2018-06-03 18:58 森森2017 阅读(130) 评论(0) 推荐(0) 编辑
摘要: # 内置函数# print(all(' '))# 一定要传可迭代对象,例如元组# print(all((1,2,None,'r')))## print(all((1,2,3,'r')))## print(all(i for i in range(1,10)))# print(all((i for i 阅读全文
posted @ 2018-06-03 18:57 森森2017 阅读(152) 评论(0) 推荐(0) 编辑
摘要: # 迭代是重复做一件事情# 递归:每个人都比前一个大两岁age(n)=age(n-1)+2# def age(n):# if n==1:# return 10# else:# return age(n-1)+2## print(age(5))# 递归的效率低# 死循环# import sys# sy 阅读全文
posted @ 2018-06-03 18:57 森森2017 阅读(198) 评论(0) 推荐(0) 编辑