words = s.split('/')
for word in words:
    new_word = ''
prev = None
for i in range(0, len(word)):
    if prev is not None and word[i].isupper() and word[i - 1].islower():
        new_word = new_word + '-' + word[i]
prev = word[i]
continue
new_word = new_word + word[i]
prev = word[i]
new.append(new_word.lower())
print('/'.join(new))
How to convert the following string in python?