How python uses the Any () function
This article will explain in detail how python uses the Any () function. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Any () function
Suppose you have a list of records that record the time John arrived at the workplace. If you want to know if he's been late this week, it's convenient to use the any () function. If one of the elements in the Boolean list is True, the any () function returns True.
> arrival_hours = {'Mon': 8.5,' Tue': 8.75, 'Wed': 9,' Thu': 8.5, 'Fri': 8.5} > arrival_checks = [x > 8.75 for x in arrival_hours.values ()] > any (arrival_checks) True's article on "how python uses the Any () function" ends here. I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.