0
is it possible to reduce length of this code
3 Respuestas
+ 6
print([s[0].split('@')[0] for s in charan])
or
print([s[0][:s[0].index('@')] for s in charan])
+ 1
split1=i[0].split("@")[0]
or if you want to put each element in an individual list:
split1=[i[0].split("@")[0]]
This doesn't seem to be exactly what you want, but I'm unsure of what you want your program to print if charan has more elements.
0
https://code.sololearn.com/cpwry0uv6u0g/?ref=app
made changes like this and working fine. is there a alternative way?