mercredi 4 novembre 2020

String Check with if Statement in Python

I want to check input is an equal to string or not. But, my code cannot see if statement. I think the problem is in if statement equation:

    name = input("Name: ")
    if name != str:
        print("Please enter letter answer ...")
        name = str(input("Name: "))
    else:
        print(input(name))             

I guess I cannot write name != str. But I don't know how to check input is equal to string. ???

Aucun commentaire:

Enregistrer un commentaire