17
Last seen 5 months ago
Member for 5 years, 3 months, 13 days
Difficulty Normal
Nice and clever. I think it would fit more into creative category :)
More
very nice. I did it similar, but twice where it could be in one double sort!
More
You could parse data and time with something like:
dt, tm = time.split()
day, month, year = map(int,dt.split('.'))
More
Nice. But, I think I don't quite understand it. is return value always to the point we iterate ?
More
Perhaps, more clear to read would be:
date, hours = time.split()
day, month, year = date.split('.')
h, m = hours.split(':')
hour = "hour" if h == '01' else "hours"
minute = "minute" if m == '01' else "minutes"
etc.
More
enough to put in one line ie:
return [x for x in data if data.count(x)>1]
More
can optimize to:
uni_list=[]
for i in data:
if data.count(i) > 1:
uni_list.append(i)
return uni_list
and when you see that, next step coult be to refactor into list comprehensions:
return [item for item in data if data.count(item) > 1]
More