mercredi 20 septembre 2017

python Print random strings with if else statement

import random
import time 
greetingsKeyword = ["hello", "hi", "whatsup", "sup"]
geetingresponse = ["hi", "hello", "how you doing?"]
keywordd = random.choice(greetingsKeyword)
resposne = random.choice(geetingresponse)
user_input = input()
if (user_input == greetingsKeyword):
    print (resposne)
else:
    print ("bye")
time.sleep(5)

I cant fix it i was trying to find answer in internet but nothing :(




Aucun commentaire:

Enregistrer un commentaire