You are viewing a single comment's thread. Return to all comments →
My code for Python (3)
import re import sys data = sys.stdin.read() pattern=r'^\([\-\+]?(90(\.0{1,})?|(|[1-8][0-9]|[1-9])(\.[0-9]{1,})?)\,\s?[\-\+]?((180(\.0{1,})?|(|1[0-7][0-9]|[1-9][0-9]|[1-9])(\.[0-9]{1,})?))?\)$' for line in data.split("\n")[1:]: match = re.findall(pattern, line) print("Valid" if match else "Invalid")
Seems like cookies are disabled on this browser, please enable them to open this website
Detecting Valid Latitude and Longitude Pairs
You are viewing a single comment's thread. Return to all comments →
My code for Python (3)