fa
Feedback

فریب کلاهبرداران را نخورید! تل‌متریو این کانال‌ها را شناسایی و برچسب‌گذاری می‌کند 👉 برای مشاهده برچسب، اشتراک تهیه کنید

Free Python Course

Free Python Course

رفتن به کانال در Telegram
5 967
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-357 روز
-22530 روز
آرشیو پست ها
#Mɪᴛʀᴏᴏᴏ...
#Mɪᴛʀᴏᴏᴏ...

What an extraordinary moment! Heartiest congratulations to all Indians on the successful soft landing of #Chandrayaan3 🚀 Imm
What an extraordinary moment! Heartiest congratulations to all Indians on the successful soft landing of #Chandrayaan3 🚀 Immense gratitude to ISRO for their dedication & brilliance in making this historic achievement possible 🇮🇳

200 Pages Full Python Course Pdf Download For Free 🚀 🔗 Link : https://shrs.link/kcHVMg Watch The Video To Know How To Get Access To Pdf 🙏

Chapter Started Join Fast ⚡

photo content

New Users Start Reading Our Free Course From Pinned Post 📌

Chapter 8 Coming...

New Users Check Pinned Msg 📌

FILTER FUNCTION The filter() method filters the given sequence with the help of a function that tests each element in the sequence to be true or not. data = [1,2,3,4,5,5,6,6,7,9,10] var = list(filter(lambda x : x%2==0 , data)) print(var) Output : [2, 4, 6, 6, 10]

MIN FUNCTION This function is used to compute the minimum of the values passed in its argument and lexicographically smallest value if strings are passed as arguments. a = [4,328,38,62] print("The Maximum Value Is : ",min(a)) Output : 4

MAX FUNCTION This function is used to compute the maximum of the values passed in its argument and lexicographically largest value if strings are passed as arguments. a = [4,328,38,62] print("The Maximum Value Is : ",max(a)) Output : The Maximum Value Is : 328

REDUCE FUNCTION EXAMPLE : from functools import reduce li = [5, 9, 12, 22, 40, 95] sum = reduce((lambda x, y: x + y), li) print(sum) Output : 183

WORKING OF REDUCE FUNCTION At first step, first two elements of sequence are picked and the result is obtained. Next step is to apply the same function to the previously attained result and the number just succeeding the second element and the result is again stored. This process continues till no more elements are left in the container. The final returned result is returned and printed on console.

REDUCE FUNCTION The reduce(fun,seq) function is used to apply a particular function passed in its argument to all of the list elements mentioned in the sequence passed along.This function is defined in “functools” module

ALL FUNCTION EXAMPLE : 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) Output : True False

ALL FUNCTION SYNTAX : all(list of iterables)

ALL FUNCTION All Returns true if all of the items are True (or if the iterable is empty). All can be thought of as a sequence of AND operations on the provided iterables. It also short circuit the execution i.e. stop the execution as soon as the result is known.

ANY FUNCTION EXAMPLE : 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) Output: False True

ANY FUNCTION SYNTAX : any(list of iterables)