How to find the longest string in a list?
This list has both strings and list of strings.
a set of strings, but the weirdness comes in that the strings I'm checking are in lists and those lists are mixed in with strings in a larger list.
Example value for 'entries':
extries = [["this is text", "more text"], "another string"]
python code
length = 0
for i in entries:
if(type(i) is list):
for x in i:
x = str(x)
if length << len(max(i, key = len)):
length = len(max(i, key = len))
else:
for i in entries:
i = str(i)
if length << len(i):
length = len(i)
This should make
length = len(max(["this is text","more text","another string"])
but it is making length = 0.