In the code below, you need to write unit tests to evaluate a function named split_pay.
split_pay(amount: str, people: int) -> float: Consumes an amount representing an amount in dollars (e.g., "$2.50") and a positive number of people, and determines how much money each person should get (as a float) such that everyone gets the same amount. The dollar amounts will always be strings. They may or may not start with a dollar sign, and they may or may not end in a decimal plus two digits. Otherwise, however, they should be proper numbers. If the arguments are invalid, then the float 0.0 should be returned.To be precise:
amount is an optional $ followed by a whole number of dollars, a decimal point with exactly two digits of cents, or both.people is always an integer; it is valid when it is greater than 0.assert_equal treats floats that are within 0.0001 of each other as equal.Remember: You should not implement the split_pay function yourself! Write the tests!
split_payis only available when you submit. In the sandbox (To sandbox, then Run), running your code only lists your tests: it can’t tell you whether they pass.