#43 Python Tutorial for Beginners | Filter Map Reduce



Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist :
Python Tutorial in Hindi :

Github :-

Editing Monitors :

Check out our website:

Follow Telusko on Twitter:

Follow on Facebook:
Telusko :
Navin Reddy :

Follow Navin Reddy on Instagram:

Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :

Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20

Nguồn: https://benjaminjcohen.com/

Xem thêm bài viết khác: https://benjaminjcohen.com/cong-nghe/

25 Comments

  1. "what is wrong with me"😂😂😂😂😂😂

  2. Why we don't write sum like this? Sum=list(reduce(lambda a, b:a+b ,doubles))

  3. Just wanted to let you know that you are amazing!

  4. why we list is written before filter please explain me sir

  5. from functools import reduce
    def isEven(n):
    return n%2==0
    def isOdd(n):
    return n%2!=0
    lst = [1,3,5,7,4,43,6,7,84,36,7]
    print(list(filter(isEven, lst)))
    print(list(filter(isOdd, lst)))

    print("Even and Odd Numbers in List")
    print(list(filter(lambda n : n%2==0, lst)))
    print(list(filter(lambda n : n%2!=0, lst)))
    print("Doubles Even and Odd Numbers in List")
    print(list(map(lambda n : n ** 2, list(filter(lambda n : n%2==0, lst)))))
    print(list(map(lambda n : n ** 2, list(filter(lambda n : n%2!=0, lst)))))
    print("Reduce Doubles Even and Odd Numbers in List")
    print(reduce(lambda a, b : a + b, list(map(lambda n : n ** 2, list(filter(lambda n : n%2==0, lst))))))
    print(reduce(lambda a, b : a + b, list(map(lambda n : n ** 2, list(filter(lambda n : n%2!=0, lst))))))

  6. def isEven(n):
    return n%2==0
    def isOdd(n):
    return n%2!=0
    lst = [1,3,5,7,4,43,6,7,84,36,7]
    print(list(filter(isEven, lst)))
    print(list(filter(isOdd, lst)))

    print(list(filter(lambda n : n%2==0, lst)))
    print(list(filter(lambda n : n%2!=0, lst)))

  7. how would i create a code to allow the user to input a list?

  8. all things are clear but i really like comprehensions

  9. I like the way of u teaching sir superb…… 👌👌

  10. I have a doubt. If anyone clarify it will be useful for me.
    For element in the iterable the lamba function will be called?
    What if we have 2 arguments for lamba function inside map or filter ? We are not passing any arguments how does it know then?

  11. Can I use these on an array????

  12. thank you sir for explaining so easily…

  13. num=[8,9,7,8,5]

    sum=list(map(lambda a,b:a+b, num,num))

    print(sum) y is this not working

  14. for what other purpose can we use 'reduce'

  15. def powerOfTwo(num):

    return num ** 2

    lst = [1, 2, 3, 4]

    power_of_two= list(filter(powerOfTwo,lst))

    print(power_of_two)
    output-[1, 2, 3, 4]
    why it is returning the same list as you said that the return value of function will be put in the list?

  16. Why did he take reduce two times??

  17. how lambda function fetch values from list while using filter, map and reduce function?

  18. Reduce keyword isn't defined is the error. Also, I'm not clear with difference in map, and filter.

  19. can u plz suggest few exercises sir to put hands on

  20. I have only one doubt, at 4:40 in place of filter if we use map…output comes in terms of true and false ….?!?!?!

  21. Your smart explanation helps me to get out of my fear in learning python😍😍😍

  22. explain why we should write list(filter(fun,seq)). while printing filter(), we are getting <filter object at 0x00DF1109>. what do you mean by this? explain?

  23. from functools import reduce

    lst = [2,4,5,25,21,66]

    evens = list(filter(lambda n : n%2==0,lst))

    doubles = list(map(lambda n : n*2,evens))

    sum = (reduce(lambda a,b : a+b,doubles))

    print(evens)

    print(doubles)

    print(sum)

  24. Damn bro you are fab 🖤🔥 .

Leave a Reply

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