List Comprehension in Python

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

Комментарии • 63

  • @dsalgos
    @dsalgos 7 месяцев назад +9

    You must be very good at planning things !! Your videos are extremely organized !! Watching like a Web series !!

  • @harishmahajan6845
    @harishmahajan6845 Год назад +28

    home work problem = using for loop list print First char in Capital.
    this is by using list comprehension
    animals = ['lion','tiger','monkey','elephant','frog']
    filtered_animal = [animal.title() for animal in animals]
    print(filtered_animal)

  • @atikshahriar382
    @atikshahriar382 21 день назад +1

    You are simply fantastic,Thank you

  • @edubuddy5805
    @edubuddy5805 День назад

    Thank you very much neso academy for helping to understand this topic❤❤

  • @Arian003Mi
    @Arian003Mi 7 месяцев назад

    Wow man you explain programming best out of other youtubers ngl

  • @jereddymanojkumar3830
    @jereddymanojkumar3830 Год назад +18

    animals =[ 'lion' ,'tiger', 'monkey', 'elephant', 'frog']
    filtered_animals=[ animals.tittle() for animal in animals ]
    filtered_animals=['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']
    When we use tittle() method on string it will do each letter of first character will upper case remaining lower case and it will return string and it doesn't take parameters

  • @izainonline
    @izainonline 7 месяцев назад +4

    This concept can be used in data scrapping like extracting the data and saving in j.names[ ]
    My suggestion is to give examples of code can be used in what scenarios so that interest and concept will be strong for new learners.

    • @asahade3847
      @asahade3847 6 месяцев назад

      @@izainonline hello . Do you have a Channel..? Thanks for the tip.

  • @Anonymous-k9m7g
    @Anonymous-k9m7g Год назад +18

    Your teaching language owesom 😅 sometimes I forget that you are speaking in English 😅

    • @izainonline
      @izainonline 7 месяцев назад

      😂

    • @RuralLifeAndNature
      @RuralLifeAndNature 5 месяцев назад

      😂 same situation

    • @DVST23
      @DVST23 2 месяца назад

      I like his teaching and voice....ty brother 😂😂

  • @mohammedrezk8072
    @mohammedrezk8072 Год назад +11

    Thx and my answer is
    filtered_animals= [x.title() for x in animals ]
    please let me what's correct answer..

  • @jingersatuh6322
    @jingersatuh6322 11 месяцев назад +1

    This is a hard topic, but well explained.

  • @vigilante191
    @vigilante191 4 месяца назад

    animals=["lion","tiger","monkey","elephant","frog"]
    filtered_animals=[animal.title() for animal in animals]
    print(filtered_animals)..
    thanks neso academy

  • @monishamoni.k2543
    @monishamoni.k2543 Месяц назад

    i like this explanation

  • @manojsingh5757
    @manojsingh5757 Месяц назад

    please make a detailed step by step video on Transpose of matrix topic in python. 🙏

  • @Harbingersknight21
    @Harbingersknight21 10 месяцев назад +1

    Homework question answer -:
    animals = ['lion' , 'tiger' , 'monkey' , 'elephant' , 'frog']
    filtered_animals=[animal.title() for animal in aminals]
    print(filtered_animals)

  • @thisulakagunaweera2958
    @thisulakagunaweera2958 Месяц назад

    thanks!

  • @pgkgaming4229
    @pgkgaming4229 9 месяцев назад

    Osm teaching nice explanation ❤❤❤

  • @II_Emilia_II
    @II_Emilia_II Год назад

    Very helpful, thanks :)

  • @AlexandraSasha
    @AlexandraSasha 11 месяцев назад

    #list comprehension(conv. from for loop), shortened list
    animals = ['lion', 'tiger', 'python']
    filtered_animals=[animal.title() for animal in animals]
    print(filtered_animals) # Output: ['Lion', 'Tiger', 'Python']

  • @RahulSingh-qs9ed
    @RahulSingh-qs9ed 10 месяцев назад +1

    animal = ["lion","tiger","monkey","elephent","frog"]
    Fanimal = [a.title() for a in animal]
    print(Fanimal)

  • @WhatsonthemenubyRoopali
    @WhatsonthemenubyRoopali 3 месяца назад

    filtered_animals = [animal.title() for animal in animals]
    filtered _animals
    Enter
    List comprehension answer!!

  • @asahade3847
    @asahade3847 6 месяцев назад

    What is the animal.title function and why followed by the ()..
    Thanks

    • @jsmphompho8052
      @jsmphompho8052 6 месяцев назад

      it's a string method used to convert a first character of a string to an uppercase then the rest are converted to lowercase characters

  • @santoshluhar2626
    @santoshluhar2626 Год назад +8

    [animal.title() for animal in animals]

    • @tayyab.sheikh
      @tayyab.sheikh 7 месяцев назад +1

      I was gonna comment the same!

  • @bhargav10x9
    @bhargav10x9 2 месяца назад

    fa=[animal.title() for animal in animals]

  • @NormieDead
    @NormieDead 10 месяцев назад

    Ans:
    ```
    animals = ['lion', 'tiger','monkey','elephant','frog']
    filtered_animals = [animal.title() for animal in animals ]
    print(filtered_animals)
    ```

  • @Raja-tt4ll
    @Raja-tt4ll 8 месяцев назад

    Super

  • @archanavennela8737
    @archanavennela8737 8 месяцев назад

    Sir can we have python DSA classes please

  • @stellamargy8075
    @stellamargy8075 Год назад +1

    filtered_animals=[animal.title() for animal in animals ]

  • @lionelfaith3646
    @lionelfaith3646 Год назад

    animals= ['lion','tiger','monkey','elephant','frog']
    filtered_animals=[animal.title() for animal in animals]
    print(filtered_animals)
    output: ['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']

  • @Yomdheal
    @Yomdheal 8 месяцев назад

    list(print("animal.title()" for animal in animals))

  • @dsalgos
    @dsalgos 7 месяцев назад

    filtered_animals = [value.title() for value in animals]

  • @jingersatuh6322
    @jingersatuh6322 11 месяцев назад

    >>> animals = ["lion", "tiger", "monkey", "elephant", "frog"]
    >>> filtered_animals = [animal.title() for animal in animals]
    >>> filtered_animals
    ['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']

  • @abhasjaiswal2384
    @abhasjaiswal2384 Год назад

    animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
    filtered_animals = [animal.title() for animal in animals]

  • @suchetrana156
    @suchetrana156 Год назад +1

    ani = ['lion', 'tiger', 'monkey','elephant']
    ani_2 = [x.title() for x in ani ]
    ani_2

  • @kingR-p6n
    @kingR-p6n 7 месяцев назад

    animals = ["lion", "tiger", "elephant", "monkey", "frog"]
    animals_2 =[animal.title() for animal in animals]
    print(animals_2)

  • @sskilledgame4132
    @sskilledgame4132 2 месяца назад

    sir new list append ethods kar sath hai

  • @JignaPatel-q7h
    @JignaPatel-q7h 6 месяцев назад

    i'm not able to run list comprehension example .

  • @AbdulDanmalan
    @AbdulDanmalan Год назад

    filtered_animals = [ "animal title() " for animal in animals]

  • @zokbrains1129
    @zokbrains1129 8 месяцев назад

    >>>animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
    >>>Filtered _animals = [animal_title() for animal in animals]
    >>>Filtered _animals
    ['lion', 'tiger', 'monkey', 'elephant', 'frog']
    >>>

  • @somanathking4694
    @somanathking4694 Год назад

    animal = [i.title() for i in animals]
    animal
    ['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']

  • @Lalitamm
    @Lalitamm Год назад

    animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
    filtered_animals = [animal.title() for animal in animals ]
    print(filtered_animals)

  • @sigmatronX
    @sigmatronX 10 месяцев назад

    animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
    filtered_animals = [ ]
    filtered_animals = [name.title( ) for name in animals]
    print(filtered_animals)

  • @sonamankit4969
    @sonamankit4969 2 месяца назад

    animals=['lion', 'tiger','monkey','elephant','frog' ]
    update_animals=[animal.title() for animal in animals ]
    print(update_animals)

  • @nithishm6619
    @nithishm6619 Год назад

    animals = ['lion','tiger','monkey']
    f_animals = [animal for animal in animals]
    print(f_animals)

  • @Movie_in_hindi8
    @Movie_in_hindi8 10 месяцев назад

    #Homework
    filtered_animals = [animal.title() for animal in animals]
    print(filtered_animals)

  • @chriswa3346
    @chriswa3346 Год назад +3

    First

  • @madhav.s2707
    @madhav.s2707 6 месяцев назад

    name for name in names if "J" in name... You could think of anything more complex🤣

  • @kingR-p6n
    @kingR-p6n 7 месяцев назад

    animals = ["lion", "tiger", "elephant", "monkey", "frog"]
    animals_2 =[animal.title() for animal in animals]
    print(animals_2)

  • @deviprasadpandey
    @deviprasadpandey Год назад

    filtered_animals=[animal.title()for animal in animals]

  • @mesonchakma6442
    @mesonchakma6442 3 месяца назад

    animals = ['lion', 'tiger', 'monkey','elephant','frog']
    filtered_animal = [ animal.title() for animal in animals ]
    print(filtered_animal)

  • @joshualeblanc1276
    @joshualeblanc1276 9 месяцев назад

    filtered_animals = [animal.title() for animal in animals]

  • @mohammedzakidarga4802
    @mohammedzakidarga4802 7 месяцев назад

    filtered_animals = [animal.title() for animal in animals]

  • @peakyblinders3365
    @peakyblinders3365 7 месяцев назад

    filtered_animals = [animal.title() for animal in animals]

  • @lingeshmaster3113
    @lingeshmaster3113 6 месяцев назад

    filtered_animals = [animal.title() for animal in animals]

  • @curiositycure14
    @curiositycure14 6 месяцев назад

    filtered_animals=[animal.title() for animal in animals]

  • @Rolexgupta-e2d
    @Rolexgupta-e2d 2 месяца назад

    filtered_animals = [animal.title() for animal in animals]