Monday, April 7.
  • Breaking News

    How to filter a list of names using python


    superheros = ["Hanuman", "Ashwadhaama", "Bali", "Vibhishana", "Krishna", "Parasurama", "Vyasa"]


    filtered_list = [hero for hero in superheros if "man" in hero]

    print(filtered_list)


    output
    ['Hanuman']

    1 comment: