+ 1

Beginner on Python

How to capatalize the answer given in an input statement to match with True/False or Yes/No if answer is typed in the input box as lower case true/false or yes/no? a = True octo_heart = input((T/F) "Octopuses have 3 heart? : ") If octo_heart == a print("Answer is correct") else: print("Answer is incorrect")

4th May 2020, 3:30 PM
DATAJAMES
DATAJAMES - avatar
3 Respuestas
+ 2
Hello kevin, here is the corrected code :)) Use the capitalize() method to make any string's every words capitalized! https://code.sololearn.com/cSFRuPzH1oA1/?ref=app
4th May 2020, 3:44 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
Thank you very much. I will give both a try. More methods i can learn the better🙏. Thank you
4th May 2020, 4:10 PM
DATAJAMES
DATAJAMES - avatar