list comprehension

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 26

  • @Jaimin_Bariya
    @Jaimin_Bariya Місяць тому +1

    Jp here again [comment number 26]
    Thank you, Sir, :)

  • @arjunpukale3310
    @arjunpukale3310 5 років тому +4

    At 8:32 there is a mistake. It should be for x in range(100)

    • @icecut7403
      @icecut7403 4 роки тому

      Okok bro itna to chalta hai

    • @samyakjain512
      @samyakjain512 4 роки тому +1

      bhot tez ho rhe ho... hehehehe
      nice concentration buddy!!!

  • @Mystic_frets
    @Mystic_frets 2 місяці тому +1

    Range for pythagorean triplets must be from 1 since side of triangle cant be zero

  • @nirajkamalk2444
    @nirajkamalk2444 4 роки тому +2

    #the statement is not working
    l = [square(x) for i in range(100) if iseven(x)]
    Traceback (most recent call last):
    File "", line 1, in
    File "", line 1, in
    NameError: name 'x' is not defined
    i defined square and iseven functions

    • @nirajkamalk2444
      @nirajkamalk2444 4 роки тому +3

      I got it , the statement should be
      l = [square(x) for x in range(100) if iseven(x)]

  • @thanveerahamed506
    @thanveerahamed506 3 роки тому +6

    I feel things could have been explained with more depth in this video.

  • @ok_7566
    @ok_7566 6 років тому +1

    also you can try for 3x3 matrix
    a=[0]*3
    b=[]
    for i in range(0,3):
    b.append(a)
    print(b)

    • @dragon_warrior_
      @dragon_warrior_ 4 роки тому +1

      u mad bro? this will create duplicate lists and all the list will point to a so not a good way to initialize this way

    • @NomanKhan-jf6pq
      @NomanKhan-jf6pq Рік тому

      Or you can also do
      a=[0]*3
      b=[a]*3
      print(b)
      But I think the one shown in the video is better because it does the same thing in one line

  • @dragon_warrior_
    @dragon_warrior_ 4 роки тому +2

    Python is really good dude I mean it provides methods like maps, comprehensions !!! wow

    • @lakshman587
      @lakshman587 4 роки тому +1

      Ya even I was impressed with list comprehension!

    • @karthikreddygaddam3104
      @karthikreddygaddam3104 3 роки тому +1

      @@lakshman587 me2

    • @lakshman587
      @lakshman587 3 роки тому

      @@karthikreddygaddam3104 Tommorow is the online exam for me😁😁
      Are you also attending?

    • @karthikreddygaddam3104
      @karthikreddygaddam3104 3 роки тому

      @@lakshman587 yes😁

    • @pd99Happy
      @pd99Happy 3 роки тому

      How was the question for programming ??

  • @sohom004
    @sohom004 7 років тому

    Thanks