Parsing HTML tables

In this video i.e Web Scrappng03 : In[69] Please explain the line where enumerate is used.And also whydo we have 2 variables idx and data.How do we know idf will get index and data will get data info

Hey saurabh,

in a for loop we can iterate over list of items, But if we want to get the index also along with data, we can use enumerate function. In our case, we wanted to different different type of content according to the index, bcoz 1st and 4th columns are bit different.

Example of enumerate :

l1 = ["eat","sleep","repeat"] 

for count,ele in enumerate(l1): 
    print(count,ele)

result : 
0 eat
1 sleep
2 repeat

I hope this clears your doubt.
Thanks :slight_smile:

yeah i got it.Thanks for clearing my doubt

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.