I have a field that has three entries as strings: "278957", "278961", and "12345678". When I use if/elif/else I can correctly replace the first two conditions in my code below but the problem is that for all entries that do not meet the conditions the values are replaced with . I thought writing "else: dsm == dsm" would preserve the original values if no conditions were met but it instead it overwrites the values to . Where am I going wrong?
def ifDSM(dsm): if dsm == "278957": return "10002343" elif dsm == "278961": return "10000550" else: dsm == dsm