import re
# Replace each series of non-space characters [^\s]+ with "newword"
sentence = 'hello world'
sentence = re.sub(r'[^\s]+','newword',sentence)
print(sentence)