diff --git a/OddOrEven.py b/OddOrEven.py index 2a7921d..a80af80 100644 --- a/OddOrEven.py +++ b/OddOrEven.py @@ -1,5 +1,8 @@ -n = int(input("Enter a number")) -if(n%2==0): +try: + n = int(input("Enter a number")) +except: + print("Please provide a valid integer number") + +if n%2==0: print("Even number.") -else: - print("Odd number.") +print("Odd number.") diff --git a/README.md b/README.md index 13e3cb8..5a0a92f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # Practice-Python -This repository will be a collection of solutions for programs given in various Python practice websites like practicepython.org, hackerrank etc. +This repository provides simple and elegant solutions for various coding questions given in various Python practice websites like practicepython.org, hackerrank etc.