Skip to content
Advertisement

How find index where the item length less than x in python

for example i have a list which contain:

JavaScript

For example, I want to get the index of the item that the length is less than 30. How to do that?Is it possible?

Advertisement

Answer

you can use enumerate function and list comprehention for this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement