表达式indea for inder, walve in
enumerate([3,5,7,3,7]) if value ==
max([3,5,7,3,7])的值为 这个是什么意思啊,怎么看呀
enumerate()函数可以同时获得一个数组的下表和对应的值,所以代码上的for index,value会有这两个参数
如果还是不懂,可以看看这篇文章
https://blog.csdn.net/weixin_43401055/article/details/107131784?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166773196616800192269582%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=166773196616800192269582&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-2-107131784-null-null.142^v63^control,201^v3^control_2,213^v1^t3_esquery_v2&utm_term=enumerate&spm=1018.2226.3001.4187
enumerate 这个就是会遍历列表每个元素时候把他对应的下标也返回,就是会返回这样的数据:
0 3
1 5
2 7
3 3
4 7