I'm learning python, I'm still in the newbie exercises...So have an exercise where I need to say the ideal weight to the height of the people,considering its genre... So my code it is:
#!/ sr/bin/python
heigth = float(input("Enter the height of the person: "))
sex = input("Enter the person's gender:")
if(sex == "male"):
pi = (72.7 * heigth) - 58
elif(sex=="female"):
pi = (62.1 * heigth) - 44.7
else:
print("Invalid gender")
print("The ideal weight for this person is:",pi)
And the error:
File "n13.py", line 3, in sex = input("Enter the person's gender:") File "", line 1, in NameError: name 'female' is not defined
I don't understanding why the string in the comparison have to be defined if it is just a string??? o.O
Thanks in advance!