1.知道了一些图书的信息,找出其中最小的价格:
#!/usr/bin/pythonbooks=[ { "name":"abc","price":23.3,"store":u"xinhu"}, { "name":"win","price":12.3,"store":"kk"}, { "name":"kk","price":11,"store":"koko"}, { "name":"linux","price":0.3,"store":"yamx"}, ]res = min(item[x] for item in books for x in item if "price" == x)print res