DEV Community

Discussion on: python challenge_6

Collapse
 
elnaznasiri profile image
elnaz-nasiri • Edited

My solution is:

def add_dots(string):
    newString = '.'.join(string)
    return newString

print(add_dots("test"))
Enter fullscreen mode Exit fullscreen mode
def remove_dots(string):
    splitString = string.split(".")
    newString = "".join(splitString)
    return newString


print(remove_dots("t.e.s.t"))
Enter fullscreen mode Exit fullscreen mode
print(remove_dots(add_dots("test")))
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mahmoudessam profile image
Mahmoud EL-kariouny

Thanks for sharing you can test your solution here: pythonprinciples.com/challenges/