Any & all function in Hindi | Python Any & all function with examples

Any & all function – Python Me Any or all function in bulit function hai | joki kisi number ko any & all find karne ke liye istemal hota hai |

Python Any & all function in Hindi

Any & all function ko Or Accha Samanjh ne ke liye iske A To Z example dekhte |

Any & all function in Hindi
Any & all function in Hindi | Python Any & all function with examples

python All() function

Jab Ham All Function ka istemal karte hai to All Function Iterable me ye chack karta hai ki all value True hai ya nhi lekin agar all value true hai to ye return me true karega |

Ham All Function ka istemal karke ye pta karte hai ki list me di gyi all value even hai ya nhi | Let See Example 1

Example 1 :-

list_1  = [2,4,6,8,10]     # all even no
list_2 =  [2,5,1,6,7]      # all not even no

list_1check= all([num%2==0 for num in list_1])
list_2check= all([num%2==0 for num in list_2])

print(list_1check)
print(list_2check)

Aap Upper Diye Gye Program ko aap samanjh sakte hai. or dekh sakte hai hamne 2 list create ki ek list me total even or dusri list me even and odd dono number liye hai|

Output :-

True                                                                                                                          
False 

Aap upper Diye gye output ko dekh Sakte hai, or 1 list ka output TRUE aaya hai kyoki total even number the isliye lekin dusri list ka FALSE aaya hai kyoki us list me even and odd dono number the |

python Any() function

Jab Ham Any Function ka istemal karte hai to Any Function Iterable me ye chack karta hai ki any value True hai ya nhi lekin agar any value true hai to ye return me true karega |

Ham Any Function ka istemal karke ye pta karte hai ki list me di gyi koi ek value even hai ya nhi | Let See Example 2

Example 2 :-

list_1  = [1,3,5,7,9]     # all even no
list_2 =  [3,5,6,11,7]      # all not even no

list_1check= any([num%2==0 for num in list_1])
list_2check= any([num%2==0 for num in list_2])

print(list_1check)
print(list_2check)

Aap Upper Diye Gye Program ko aap samanjh sakte hai. or dekh sakte hai hamne 2 list create ki 1 list me keval even number or dusri list me total odd number liye hai |

Output :-

False
True

Aap upper Diye gye output ko dekh Sakte hai, or 1 list ka output FALSE aaya hai kyoki list_1 me keval ek even number the isliye , lekin dusri list ka TRUE aaya hai kyoki us list me odd number the |

Any & all function in Hindi

Some Related Post

Dosto mujhe ummed hai ki aap Python Any & all function with examples ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Summary
Review Date
Reviewed Item
Python Any & all function with examples
Author Rating
51star1star1star1star1star

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)