lundi 8 février 2021

How Can I Use Lists With If/Else In Python

list= ["hi","hello","how are u"]
question= input("please write something")

if list in question:
 print("1")

if question in list:
 print("2")

Hey, i am trying to make something, i want to use lists with if else statement. When user write something example "hello what are u doing" and when if statements see the "hello" program will say something.

Aucun commentaire:

Enregistrer un commentaire