for row in moma :
Gender = row
if not Gender:
Gender = "Gender Unknown/Other"
row = Gender
Nationality = row
if not Nationality :
Nationality = 'Nationality unknown'
row = Nationality
What I expected to happen:
that values in moma dataset will be changed
What actually happened:
value didn’t change…: or something else
The value of moma is not what we expected.
One of your variables doesn't seem to have the correct value. Please re-check the instructions and your code.```
Check the question and my response here - Trying to understand why do I have to assign a variable inside a for loop - #3 by the_doctor to see what you could potentially be doing wrong. Compare my response to your code and try to understand it first.
Secondly, pay closer attention to the case you use for strings. It’s
Nationality Unknown (
U and not
Thank you. I’ve noticed that my mistake was not assigning the capitalized value to the same variable, but please could you explain more why do I have to do this assignement.
The link I shared does explain the why. Is there anything specific that’s unclear to you?
thank you, after revisiting the post, things are clear!