How to remove the N character from all the strings in a list of strings with Python

1 Answer

0 votes
lst = ["python", "java", "PHP", "c#", "pascal", "vb.net"] 
 
N = 2

lst = [ele[:N] + ele[N + 1:] for ele in lst] 
 
print(lst) 
 
 
 
'''
run:
 
['pyhon', 'jaa', 'PH', 'c#', 'pacal', 'vbnet']
 
'''

 



answered Jan 13, 2020 by avibootz
...