breaking out of a loop

Поділитися
Вставка
  • Опубліковано 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.

КОМЕНТАРІ • 25

  • @Jaimin_Bariya
    @Jaimin_Bariya 22 дні тому +1

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

  • @rahulkumargupta9565
    @rahulkumargupta9565 6 років тому +25

    the increment in ''i'' is missing within the while loop ?

  • @bejorrani
    @bejorrani 2 роки тому +2

    the increment in ''i'' is missing within the while loop at @1:16
    while L

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

    Nicely explaining all the concepts.

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

    It is necessary to know every possibility or we can simply know or use a simplest way??
    ⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔
    Please reply!!!

    • @vigneshsvicky2110
      @vigneshsvicky2110 2 роки тому +1

      if we know more possibility , we can write efficient program. The aim is to write code efficiently i.e.., time complexity , space complexity.,,,,You will learn it while you read data structures.
      Thank You. :)

  • @Itsmethanu....-_1320
    @Itsmethanu....-_1320 2 місяці тому

    When using for condition instead of while there is no colon for defining of the function
    Why God 😭 why even randomly youtuber explained this very well 😭😭

  • @may21136
    @may21136 5 років тому +1

    Sir, in the findpos function def, are you initializing variables in tuples?

    • @muralidhar40
      @muralidhar40 2 роки тому

      They are not tuples, it is just initialization of multiple variables in a single statement

  • @yashprajapati5023
    @yashprajapati5023 4 роки тому +4

    this video went over my head

  • @codewithkaran1
    @codewithkaran1 Рік тому +1

    This cod work well for the above condition. Please check will it be correct to code this way.
    >>> def position(l,v):
    ... for i in l:
    ... if i==v:
    ... return(l.index(i))
    ... else:
    ... return(False)

  • @souravdalal2387
    @souravdalal2387 6 років тому

    Sir use of "not found" i can't understand.
    Plz help

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

      Sourav Dalal found is a Boolean value which is true or false.
      'not' in python is negation.
      not True is false.
      not 0 is True
      not (anything) gives negating Boolean.

    • @souravdalal2387
      @souravdalal2387 6 років тому

      Ashish Ranjan thanks sir....

  • @muralidhar40
    @muralidhar40 2 роки тому

    else will not be executed if break is executed.

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

    def findpos(l,x):
    ... found, pos = False, -1
    ... if x in l:
    ... found, pos = True, l.index(x)
    ... else:
    ... pos = -1
    ... return pos

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

    4:25 -------- the condition : if not found and l[i]==v .......I didn't understand this !

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

      Exactly, apko samja ho abhi to bata do bro!

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

      @@sanketargade3685 If the found value is initially false and we got value...
      then assign found=true and print the position of that value

  • @shivasai9161
    @shivasai9161 7 місяців тому

    sir,
    i didn't understand perfectly