Python: How can I make this work?

Question:

How can I make this work?

number = int(raw_input("Number: "))
if number != !!!!!!!!NUMBER TYPE IS NOT AN INT TYPEEE!!!!!!!!!
    print "NO!"
else
    print "YES!"

Thanks!! 🙂

Asked By: Eduardo Morales

||

Answers:

try:
    num = int(raw_input("Number: "))
    print("Yes!")
except ValueError:
    print("No!")
Answered By: Hugh Bothwell
number = raw_input("Number: ")

if not number.isdigit():
    print "NO!"
else:
    print "YES!"
Answered By: Katpoes
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.