Question: use python , provide complete and meaningful docstrings 8. Write a function coordinates (S) that checks if string s denotes a coordinate of a point.
use python , provide complete and meaningful docstrings
8. Write a function coordinates (S) that checks if string s denotes a coordinate of a point. This function should return True if s contains one comma and at most 2 decimal points and two or more signed digits; and False otherwise. According to this definition a negative coordinate should return True also. >>>coordinates ("12.333333,35.33432332") True >>>coordinates ("45.67,-13.33432") True >>> coordinates ("-37,24") True >>> coordinates ("-34.3 22.4") False Note that: you can use .Istrip('-') function to take care of leading sign e.g. X.Istrip('-') will remove the leading from the string X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
