Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Add two numbers.py

This file was deleted.

12 changes: 0 additions & 12 deletions Addtion of two numbers.py

This file was deleted.

3 changes: 0 additions & 3 deletions add 2 number.py

This file was deleted.

9 changes: 0 additions & 9 deletions add 2 numbers.py

This file was deleted.

7 changes: 0 additions & 7 deletions add two no.py

This file was deleted.

10 changes: 0 additions & 10 deletions add two number.py

This file was deleted.

5 changes: 0 additions & 5 deletions add_2_nums.py

This file was deleted.

24 changes: 24 additions & 0 deletions add_two_nums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
__author__ = "Nitkarsh Chourasia"
__version__ = "1.0"
def addition(
num1: typing.Union[int, float],
num2: typing.Union[int, float]
) -> str:
"""A function to add two given numbers."""

# Checking if the given parameters are numerical or not.
if not isinstance(num1, (int, float)):
return "Please input numerical values only for num1."
if not isinstance(num2, (int, float)):
return "Please input numerical values only for num2."

# Adding the given parameters.
sum_result = num1 + num2

# returning the result.
return f"The sum of {num1} and {num2} is: {sum_result}"
)

print(addition(5, 10)) # This will use the provided parameters
print(addition(2, 2))
print(addition(-3, -5))
7 changes: 0 additions & 7 deletions addtwonumber.py

This file was deleted.