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.
Jp here again [comment number 25]
Thank you, Sir, :)
the increment in ''i'' is missing within the while loop ?
Exactly!
Exactly
Exactly bro!
the increment in ''i'' is missing within the while loop at @1:16
while L
Nicely explaining all the concepts.
It is necessary to know every possibility or we can simply know or use a simplest way??
⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔
Please reply!!!
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. :)
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 😭😭
Sir, in the findpos function def, are you initializing variables in tuples?
They are not tuples, it is just initialization of multiple variables in a single statement
this video went over my head
Exactly
💯😅😅
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)
Sir use of "not found" i can't understand.
Plz help
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.
Ashish Ranjan thanks sir....
else will not be executed if break is executed.
def findpos(l,x):
... found, pos = False, -1
... if x in l:
... found, pos = True, l.index(x)
... else:
... pos = -1
... return pos
4:25 -------- the condition : if not found and l[i]==v .......I didn't understand this !
Exactly, apko samja ho abhi to bata do bro!
@@sanketargade3685 If the found value is initially false and we got value...
then assign found=true and print the position of that value
sir,
i didn't understand perfectly