Skip to content

Conversation

@prsai0110
Copy link

Problem

simple_math.add() was not handling mixed types correctly and was concatenating values.

Solution

Added a type check to raise TypeError if arguments are not int or float.

Testing

Tested with both integer and mixed types — confirmed expected behavior.

@prsai0110
Copy link
Author

I found a bug in the add() function where it doesn’t properly handle mixed string and integer types.
Instead of raising an error, it concatenates the values, producing incorrect output.

Steps to Reproduce

  1. Run this code:
import simple_math
result = simple_math.add("5", 10)
print(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant