Monday, December 17, 2018

Python Ninja Bootcamp 37-all & any function

Learn Python like a Professional! Take You from 0 to Hero






In this Python lecture, we will learn about the all() & any()

"all is the function that takes a sequence as a parameter, return
  • True- if all elements in a sequence are true or if a sequence is empty.
  • False- if any element in a sequence is false."  

"any is the function that takes a sequence as a parameter, return
  • True- if at least one element of a sequence is true.
  • False- if all elements in a sequence are false or if a sequence is empty."

Python all( ) & any( )

Let's see the example 


all([True,True,True])
>> True

all([True,True,False])
>>False

any([False,False,False])
>>False

any([False,False,True])
>>True





EDITS ARE WELCOMED!!

In the next Blog, we will discuss Q&A 6th  

https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-38-q-6th.html

......................................................................................................................................

Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

Instagram-
https://www.instagram.com/python.india/

View the Jupyter Notebook for this lecture

Download the Jupyter Notebook for this lecture 



Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com

No comments:

Post a Comment