Skip to content
Snippets Groups Projects
Commit 6505415f authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Check if list is not empty

parent 25a26de1
No related branches found
No related tags found
1 merge request!233Fix: Check if list is not empty
......@@ -478,10 +478,12 @@ def flatten_list(l):
:return: Same string or string with first and last entry of a list
"""
if isinstance(l, list):
if len(l)>1:
if len(l) > 1:
return '{}-{}'.format(l[0], l[-1])
else:
elif len(l) == 1:
return '{}'.format(l[0])
else:
return '{}'
else:
return str(l)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment