Python 3 Tutorial for Beginners #23 – Filters



Hey gang, in this Python 3 tutorial I’ll introduce you to filters, which allows us to cycle through a collection and filter out certain items within it.

—– COURSE LINKS:
+ Atom editor –
+ CMDER –
+ PYTHON –
+ GitHub Repo – + GitHub Repo –

———————————————————————————————
Other tutorials:

—– NODE.JS TUTORIALS

—– SUBSCRIBE TO CHANNEL –

============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – or

================== Social Links ==================

Twitter – @TheNetNinja –

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

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

3 Comments

  1. grades = ["a", "b", "a", "f", "f", "b", "c"]

    # print([grade for grade in grades if grade != "f" and grade != "c"])

    def remove_fails(grade):
    return grade != "f" and grade !="c"

    # a = []
    # for grade in grades:
    # if remove_fails(grade) == True:
    # a.append(grade)
    # else:
    # continue

    # print(a)

    # print([grade for grade in grades if remove_fails(grade) == True])

    print(list(filter(remove_fails, grades)))

  2. thanks a lot +TheNetNinja ! you are really awesome … I have learned lots of language from your channel . really it helped me a lot . I am going to share your channel with my friends I am sure that they will like it as much i like it .

Leave a Reply

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