mercredi 21 juin 2017

Why does it keep returning false positive? [duplicate]

This question already has an answer here:

Why is it that my code keeps returning yes in the code i've written? I cant spot my error.

def alphaToPhone(alpha):
    for i in range(len(alpha)):
        if i=="b" or "k" or "c":
            phone="yes"
        else:
            phone="no"
    return phone

print(alphaToPhone("23ht"))

Aucun commentaire:

Enregistrer un commentaire