Template of the list is:
EmployeeList = [u'<EmpId>', u'<Name>', u'<Doj>', u'<Salary>']
I would like to convert from this
EmployeeList = [u'1001', u'Karick', u'14-12-2020', u'1$']
to this:
EmployeeList = ['1001', 'Karick', '14-12-2020', '1$']
After conversion, I am actually checking if "1001" exists in EmployeeList.values().
You can do this by using json and ast modules as follows
how about:
Just simply use this code
There are several ways to do this. I converted like this
After that you can check
Hope it will help you.
We can use
map
function[str(x) for x in EmployeeList]
would do a conversion, but it would fail if the unicode string characters do not lie in the ascii range.