A solution to a project.

I was given a project in a python class which was setup by Data Science Nigeria (DSN).

I was asked to build a function named multiply that accepts two inputs argument which when run it allow a user to input two values and if one or both of the value is a string it should return “Invalid Argument” else it should return the product of the two values.

And for the second project, it’s is basic similar to the first only instead of multiply, it subtract the two values.

And below are the ways I solved them both.

Firstly, I got the two inputs from the user.

Then I checked if the values are either an integer or a string using “try”.

If it’s a string it will return “invalid argument” and if not it returns the product of the values for the first project and subtracts the values for the second project.

Thanks.