list comprehension

Поділитися
Вставка
  • Опубліковано 12 жов 2024
  • To access the translated content:
    1. The translated content of this course is available in regional languages. For details please visit nptel.ac.in/tr...
    The video course content can be accessed in the form of regional language text transcripts, books which can be accessed under downloads of each course, subtitles in the video and Video Text Track below the video.
    Your feedback is highly appreciated. Kindly fill this form forms.gle/XFZh...
    2. Regional language subtitles available for this course
    To watch the subtitles in regional languages:
    1. Click on the lecture under Course Details.
    2. Play the video.
    3. Now click on the Settings icon and a list of features will display
    4. From that select the option Subtitles/CC.
    5. Now select the Language from the available languages to read the subtitle in the regional language.

КОМЕНТАРІ • 26

  • @Jaimin_Bariya
    @Jaimin_Bariya 21 день тому +1

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

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

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

  • @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!!!

  • @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

  • @nirajkamalk2444
    @nirajkamalk2444 3 роки тому +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 3 роки тому +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.

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

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

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

    Thanks