In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you what the function of the any () function in Python is. The content is concise and easy to understand. It can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Description
The any () function is used to determine whether the given iterable parameter iterable is all False, returns False, and returns True if one is True.
Elements are TRUE except for 0, null, and FALSE.
Function is equivalent to:
Def any (iterable): for element in iterable: if element: return True return False
Python version 2.5 or later is available.
Grammar
The following is the syntax of the any () method:
Any (iterable) parameter
Iterable-- tuple or list.
Return value
Returns false if all are empty, 0, false, and true if not all empty, 0, false.
Example
The following shows an example of using the any () method:
Description
The any () function is used to determine whether the given iterable parameter iterable is all False, returns False, and returns True if one is True.
Elements are TRUE except for 0, null, and FALSE.
Function is equivalent to:
Def any (iterable): for element in iterable: if element: return True return False
Python version 2.5 or later is available.
Grammar
The following is the syntax of the any () method:
Any (iterable) parameter
Iterable-- tuple or list.
Return value
Returns false if all are empty, 0, false, and true if not all empty, 0, false.
> any (['axed,' baked, 'cased,' d']) # list list, none of the elements are empty or 0True > any (['axed,' baked,'','d']) # list list There is an empty element True > > any ([0grammar, False]) # list list, all of which are 0 tuple tuple ('axie,' baked, 'cased,' d')) # tuple, and none of the elements are empty or 0True > tuple ('axie,' baked,'','d') # tuple There is an empty element True > any ((0gramme, False)) # tuple tuple, and the elements are all 0Zhenzhengjingjie false false > > any ([]) # empty list False > any (()) # empty tuple False. What is the function of the any () function in Python? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.