+ 1

Half-working short program

Why can I get it to work if I type “male” when prompted but not when I type “female” when prompted https://code.sololearn.com/c10CvaGhbBuM/?ref=app

20th Aug 2018, 3:31 AM
Codey Lon Tesla
Codey Lon Tesla - avatar
1 Answer
+ 7
You should get input for gender only once. #enter gender gender = input("") if gender == "male": x = 78 if gender == "female": x = 80 Also, the code playground here at SoloLearn requires that you provide all the input before executing the program, and different inputs must be separated in different lines. So after my correction, you should provide input such as: female 26 Hope this helps!! 😁👍🏻
20th Aug 2018, 3:43 AM
Eduardo Petry
Eduardo Petry - avatar