[Python] How to make Python to check is variable a number or letter?

Discussão em 'Python' iniciado por Stack, Setembro 15, 2024.

  1. Stack

    Stack Membro Participativo

    Hi I have a question...

    As a Python beginner I want to ask how do I make my code to check is input from a user a number or a letter ?


    if age == int or float:
    print("Ok, zavrsili smo sa osnovnim informacijama! Da li zelite da ih uklopimo i pokazemo Vase osnovne informacije? DA ili NE ?")

    elif age == False:
    print("Hej, to nije broj... Pokusaj ponovo")


    This is part of my code that I'm having issues with. I want to make statement if user inputs his age as number, the code continues. But, if user inputs something that is not a number, code tells him to start all over( all print statements are written in Serbian, I hope you don't mind :D)

    Continue reading...

Compartilhe esta Página