I found an interesting problem on https://www.codewars.com/kata/56c0ca8c6d88fdb61b000f06:
You're fed up about changing the version of your software manually. Instead, you will create a little script that will make it for you.

# Exercice

Create a function `nextVersion`, that will take a string in parameter, and will return a string containing the next version number.

For example:

# Rules

All numbers, except the first one, must be lower than 10: if there are, you have to set them to 0 and increment the next number in sequence.

You can assume all tests inputs to be valid.

I tried it in Python, but could not do it. Can you solve it?
def next_version(version):
    c, s = version.count(".") + 1, version.replace(".", "")
    n = f"{int(s)+1:0{len(s)}d}"[::-1]
    return (".".join(n[i] for i in range(c)) + n[c:])[::-1]