In Python, a string can be split on a delimiter.  

Example:  

>>> a = "this is a string"
>>> a = a.split(" ") # a is converted to a list of strings. 
>>> print a
['this', 'is', 'a', 'string']

Joining a string is simple:  

>>> a = "-".join(a)
>>> print a
this-is-a-string 

Task 

You are given a string. Split the string on a " " (space) delimiter and join using a - hyphen.   

Function Description   

Complete the split_and_join function in the editor below.   

split_and_join has the following parameters:   

string line: a string of space-separated words   

Returns   

string: the resulting string   

Input Format 

The one line contains a string consisting of space separated words.  

Sample Input 

this is a string   

Sample Output  

this-is-a-string

Source: hackerrank | Difficulty: EASY
Tags: String algorithms


Solutions:
a = input()
b = a.split()
q = '-'.join(b)
print(q)


string = input().split()
print('-'.join(string))


word = input()
word = word.split()
word = '-'.join(word)
print(word)


a = input().split()
print('-'.join(a))


st = input()
l = st.split()
print('-'.join(l))


b = ''
a = input().split()
for i in range(len(a)):
	if b == '':
		b = b + a[i]
	else:
		b = b + '-' + a[i]
print(b)


print('-'.join(input().split()))


string = input()
string = string.split()
string = '-'.join(string)
print(string)


s = str(input()).strip().replace(' ', '-')
print(s)


n = input().split()
s = '-'.join(n)
print(s)


s = input().split()
s = '-'.join(s)
print(s)


str = input()
spl = str.split()
print('-'.join(spl))


a = input()
arr = a.split()
print('-'.join(arr))


str = input().split()
str = '-'.join(str)
print(str)


S = input()
L = S.split()
S = '-'.join(L)
print(S)


print('-'.join(input().strip().split()))


print('-'.join(input().rstrip().split(' ')))


s = input().split()
sr = '-'.join(s)
s = sr
print(s)


s = input().split()
print('-'.join(s))


import sys
S = sys.stdin.readline().strip()
print('-'.join(S.split(' ')))


string = input()
arrString = string.split()
newString = '-'.join(arrString)
print(newString)


print('-'.join(str(input()).split()))


inval = input().split()
print('-'.join(inval))


str = input().split()
print('-'.join(str))


inputString = input()
splitString = inputString.split()
joinedString = '-'.join(splitString)
print(joinedString)


s = input()
s = s.split()
s = '-'.join(s)
print(s)


res = input().split()
print('-'.join(res))


s = input()
print('-'.join(s.split()))


print('-'.join(input().strip().split(' ')))


print('-'.join(list(input().split())))


i = input().split()
print('-'.join(i))