Skip to content

Python code snippet – How to create an integer validate ?

try:
    value=int(input("Type a number:"))
except ValueError:
    print("This is not a whole number.")
See also  Python code snippet - How to play video in colab?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.