摘要: a = 5 b = 6 c = 1 def max_num(): re = (a if a>b else b)if(a if a>b else b)>c else c rt = (a if a<b else b)if(a if a<b else b)<c else c return re,rt l 阅读全文
posted @ 2020-07-21 16:21 kaiyaoweixiao 阅读(240) 评论(0) 推荐(0)
摘要: def list1(): ''' 查看元素是否在列表中,存在就返回位置,不存在就返回-1 :return: index ''' l = [1, 2, 3, 4, 5, 6] for i in range(len(l)): if l[i] == 2: return i return -1 re = l 阅读全文
posted @ 2020-07-21 15:20 kaiyaoweixiao 阅读(271) 评论(0) 推荐(0)
摘要: # dic = dict(('name','apple')) # Unexpected type(s): \ # (Tuple[str, str])报错 # Possible types: (Mapping) \ # (Iterable[Tuple[Any, Any]]) #可迭代对象必须是映射关系 阅读全文
posted @ 2020-07-21 10:24 kaiyaoweixiao 阅读(386) 评论(0) 推荐(0)