Solution Exercise 60: replace the space with hyphen in python

Exercise 60 Write a Python program that defines a function replace_spaces_with_hyphen() which takes a string s as input and returns a new string with all spaces replaced with hyphens ("-") without using the replace() method. Exemple if s = "Python is object oriented programming language" , the function must returns: "Python-is-object-oriented-programming-language".