练习python,,[Python]代码de
练习python,,[Python]代码de
[Python]代码
def sumTwoLargest(lst): a = findLargest(lst) b = findSecond(lst) sum = a+b print sumdef findLargest(lst): a = lst[1] for i in lst: if i > a: a = i return adef findSecond(lst): a = findLargest(lst) b = lst.index(a) lst.pop(b) c = findLargest(lst) return c
[Python]代码
def reverse(lst): # write your solution code here b = 1 #dict = (lst) for i in lst: if b > len(lst)/2: break a = i print a #print len(lst)-b lst[b-1] = lst[len(lst)-b] print i lst[len(lst)-b] = a b += 1 return lst
相关内容
- 正态分布概率计算,态分布概率计算,[Python]代码de
- python中如果通过索引遍历列表,python索引遍列表,pytho
- 参数化建筑-基础-附表皮,建筑表皮,建筑立面# -*- co
- 递归查找文件,递归查找,[Python]代码#!
- FFT估计,,用Python进行FFT
- Python FTP暴力破解工具,pythonftp暴力破解,[Python]代码#!
- SSH代理连接器,ssh连接器,[Python]代码#
- 从百度MP3中批量下载某歌手的歌,百度mp3歌手,download
- python之POP详解,pythonpop,[Python]代码#!
- Basic Blog,basicblog,main.pyimpor
评论关闭