Oct-13-2019, 09:55 AM
Hi everyone,
I am doing the Dataquest course and can’t really understand the following code. The following code is supposed to do capitalize every word and replace the gender with the string “Gender Unknown”
I don’t understand why the if not Gender will return True when the gender is empty. Can someone please explain to me
I am doing the Dataquest course and can’t really understand the following code. The following code is supposed to do capitalize every word and replace the gender with the string “Gender Unknown”
I don’t understand why the if not Gender will return True when the gender is empty. Can someone please explain to me
1 2 3 4 5 |
for row in moma: Gender = row[ 2 ] Gender = Gender.title() if not Gender: Gender = “Gender Unknown” |