samedi 16 mars 2019

Python noob need help list and for [on hold]

''' NEEED HELP WITH THIS TASK. THANKS :D Use an if check to see if the user has entered your name in the list. If the user has done so, print "You remembered me!" If your name is not in the list, please print "Did you forget me?"

'''

Under is what i tried to do. but it didint work... what should try to fix or what should i change ?!

svar = input("Hva heter du? ") liste = ["gunnar", "adam", "ewa", "ole", "peter","tobi", "kaj"]

if liste.index(svar) >= 0: print("du er i systemet") else: "ikke i systemet"

Aucun commentaire:

Enregistrer un commentaire