Skip to content

Commit

Permalink
Update is_number.py
Browse files Browse the repository at this point in the history
Making the program more readable and efficient by adding else statement instead of one-liner elif statement.
  • Loading branch information
NitkarshChourasia authored Aug 24, 2023
1 parent dfc844a commit 39861ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions very_easy/is_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def check_number(input_value: Any) -> str:

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


Expand All @@ -30,4 +30,4 @@ def check_number(input_value: Any) -> str:
print(check_number(0))
print(check_number(pow(10, 20)))
print(check_number("Hello"))
print(check_number(1 + 2j))
print(check_number(1 + 2j))

0 comments on commit 39861ad

Please sign in to comment.