+ 6

[challenge]Transforming a list

Given a list points = [[1,"a","b"],[2,"d","e"],[3,"e","f"]] transfer to [[1,'a,b'],[2,'b,c'],[3,'c,d']] oneliner welcome

17th Mar 2018, 3:29 PM
Oma Falk
Oma Falk - avatar
2 Answers
+ 10
Edit: print([[i[0],','.join(i[1:])] for i in points]) #this makes sense print([[i[0],','.join([chr(ord('a')+i[0]-1),chr(ord('a')+i[0])])] for i in points]) #but this answers the question https://code.sololearn.com/cUWnW042xht6/?ref=app
17th Mar 2018, 3:37 PM
Louis
Louis - avatar
+ 1
wht to do?? not clear...
20th Mar 2018, 3:56 AM
sayan chandra
sayan chandra - avatar