i’ve no idea how to resolve my problem. i ve a string like ‘0.0.0’ and i need to find all possible combinination, like ‘0.0.1’, ‘0.0.2’……. ‘9.9.9’ then compare with another string if is bigger or no.
no i’ve code like this
K = 1
res = []
for ele in version_string:
if ele.isdigit():
res.append(str(int(ele) + K))
version_string = res
version_string = ''.join(version_string)
else:
res.append(ele)
print(str(version_string))
output
0.0
1.1
2.2
3.3
4.4
5.5
6.6
this code only increment every number by one but i need all combination.
thanks
>Solution :
import itertools
for numstr in ('.'.join(map(str, p)) for p in itertools.product(range(10), repeat=3)):
print(numstr)