0
Is this correct program
gender = male if gender==male: print ("ramesh is a male") elif gender ==female: print ("sita is a female") else: print("ur transgender")
2 odpowiedzi
+ 2
Rajeev Srivastav there are a couple of issues with the code.
1. Variables male and female are undefined. Possibly you meant to compare them as literal character strings. If so, then the strings should be enclosed in quotation marks (either single or double), like this: "male", "female".
2. Indentation is missing. You must indent lines to indicate which lines belong inside the if and elif clauses. (Since the print statement in the else clause is on the same line, there is no need to indent that one).
+ 1
run the program and see what happens.