for row in moma: gender = row # convert the gender to title case gender = gender.title() # if there is no gender, set # a descriptive value if not gender: gender = "Gender Unknown/Other" row = gender
What I expected to happen:
What actually happened:
Replace this line with the output/error
Can someone tell me what is the role of “if not gender:” part. Does this method only check empty string? Please elaborate the role of “not” here.