How to have user true/false input in python?

前端 未结 7 601
野的像风
野的像风 2021-01-19 11:00

I\'m new to python.

I want the program to ask

\"is Johnny hungry? True or false?\"

user inputs True then print is

7条回答
  •  清歌不尽
    2021-01-19 11:41

    johnnyHungry = input("Is johnny hungry ")
    if johnnyHungry == "True":
    ...
    

    I expect that you can take it from there?

提交回复
热议问题