defmakenumberstr(s): ret = [] for i inrange(len(s)): _s = s if i + 1 < len(s): _s = s[:i + 1] + '.' + s[i + 1:] if isvalid(_s): ret.append(_s) return ret
s = s[1:-1]
ans = []
for i inrange(1, len(s)):
n = makenumberstr(s[:i]) m = makenumberstr(s[i:])
for _n in n: for _m in m: ans.append(f"({_n}, {_m})")
defmakenumberstr(s): ret = [] for i inrange(1, len(s) + 1): left, right = s[:i], s[i:] if (not left.startswith('0') or left == '0') andnot right.endswith('0'): ret.append(left + ('.'if right != ''else'') + right) return ret
s, ans = s[1:-1], []
for i inrange(1, len(s)):
n = makenumberstr(s[:i]) m = makenumberstr(s[i:])
for _n in n: for _m in m: ans.append(f"({_n}, {_m})")