How do I make this script work?

Asked

Viewed 25 times

0

I know that the variable will always be str but I wanted to put a value there and if it was of the whole type then check otherwise it gave the message "You have to type a NUMERIC age and not a text or decimal numbers!!" and not an error of the program itself.

#-*- coding: UTF-8 -*-

ida = input("Digite um numero: ")

if ida == type(int):
    if int(ida) >= 18:
        print("Você é maior de idade!!")
    elif int(ida) < 18:
        print("Você é Menor de idade")
else:
    print("Você tem que digita uma idade NUMERICA e não um texto ou numeros decimais!!")

  • Takes the if ida == type(int) pq input will not receive integers (in python3) ever.

  • Suggested solutions: https://answall.com/a/263153/3635

  • our helped me a lot vlw... I got Aki!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.