How to remove a String in python list



Below is the snippet to remove a string from python list of strings

a = ['fname_encr','lname_encr','address_encr']  # encr = encrypted value column

a = list(map(lambda x: x.replace('_encr',''),a)

print(a) #python 3



> ['fname','lname','address']

Comments