求解怎么用recursion实现寻找list中【第二小】的数字。。
python吧
全部回复
仅看楼主
level 1
sathga
楼主
就是输入一个list=[1,2,3,4,5]
输出要是1
第一小一下就会了,第二小到底怎么求
2015年01月27日 16点01分
1
level 1
sathga
楼主
手滑,输出要是2
2015年01月27日 16点01分
2
乌龟王八a
不是有排序么,排序后,直接去第二个啥
2015年01月27日 17点01分
sathga
回复
�ڹ�����a
:题目要求用recursion。。。
2015年01月27日 17点01分
level 5
ICEwiimaker
为什么一定要用recursion…
sorted(list)[2]应该就行了啊…
2015年01月27日 17点01分
3
ICEwiimaker
口胡 是[1]
2015年01月27日 17点01分
sathga
@ICEwiimaker
题目要求:(
2015年01月27日 17点01分
ICEwiimaker
@sathga
那我就帮不了了……对不起…:(
2015年01月27日 17点01分
level 15
江湖程序员(大号)
如图:
2015年01月28日 00点01分
4
sathga
太糊了看不清。。题目不嚷用import。。
2015年01月28日 00点01分
sathga
回复 一颗幸福python :你还记得标题里面有什么关键字吗…
2015年01月28日 17点01分
江湖程序员(大号)
@sathga
详见6楼清晰图,
2015年01月29日 02点01分
sathga
回复 一颗幸福python :谢谢了…我自己想出来了,用了一个helper function..
2015年01月29日 02点01分
level 7
A_G_Lamperouge
是有序列表还是无序列表?
2015年01月29日 00点01分
5
level 15
江湖程序员(大号)
清晰图:
2015年01月29日 02点01分
6
1