Skip to content

Commit

Permalink
sort: better organisation.
Browse files Browse the repository at this point in the history
program added by me few months ago.
  • Loading branch information
NitkarshChourasia committed Jan 16, 2024
1 parent 1263088 commit a13646d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions is_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# importing the module to check for all kinds of numbers truthiness in python.
import numbers
from math import pow
from typing import Any

# Assign values to author and version.
__author__ = "Nitkarsh Chourasia"
__version__ = "1.0.0"
__date__ = "2023-08-24"


def check_number(input_value: Any) -> str:
"""Check if input is a number of any kind or not."""

if isinstance(input_value, numbers.Number):
return f"{input_value} is a number."
else:
return f"{input_value} is not a number."


if __name__ == "__main__":
print(f"Author: {__author__}")
print(f"Version: {__version__}")
print(f"Function Documentation: {check_number.__doc__}")
print(f"Date: {__date__}")

print() # Just inserting a new blank line.

print(check_number(100))
print(check_number(0))
print(check_number(pow(10, 20)))
print(check_number("Hello"))
print(check_number(1 + 2j))

0 comments on commit a13646d

Please sign in to comment.