>>> name
['yamada', 'suzuki', 'yokoyama', 'takai', 'kashiwagi']
>>> old
[45, 21, 78, 16, 56]
>>> height
[166, 176, 170, 155, 149]
>>> weight
[78, 67, 82, 66, 53]
>>> country
['USA', 'Japan', 'Canada', 'Korea', 'UK']
>>> db = zip(name,old,height,weight,country)
>>> sorted(db,key=lambda x:(x[0],x[1]),reverse=False)
[('kashiwagi', 56, 149, 53, 'UK'), ('suzuki', 21, 176, 67, 'Japan'), ('takai', 1
6, 155, 66, 'Korea'), ('yamada', 45, 166, 78, 'USA'), ('yokoyama', 78, 170, 82,
'Canada')]
ほう
1 件のコメント:
oldってのはageのことかね
コメントを投稿