new branch go away abc
This commit is contained in:
28
abc.py
28
abc.py
@@ -1,28 +0,0 @@
|
|||||||
def split_and_join(line):
|
|
||||||
full = []
|
|
||||||
current = ''
|
|
||||||
line_len = len(line)
|
|
||||||
for c in range(line_len):
|
|
||||||
char = line[c]
|
|
||||||
if char == ' ':
|
|
||||||
full.append(current)
|
|
||||||
current = ''
|
|
||||||
else:
|
|
||||||
current = current + char
|
|
||||||
|
|
||||||
if c == line_len - 1:
|
|
||||||
full.append(str(current))
|
|
||||||
|
|
||||||
full_final = ''
|
|
||||||
full_len = len(full)
|
|
||||||
for v in range(full_len):
|
|
||||||
val = full[v]
|
|
||||||
full_final += val + ('' if v == full_len-1 else '-')
|
|
||||||
|
|
||||||
return full_final
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
line = input()
|
|
||||||
result = split_and_join(line)
|
|
||||||
print(result)
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user