text = "This is a test with 10 words."
words = text.split(" ")
print(len(words))
# 7
capital_words = [w.capitalize() for w in words]
capital_text = " ".join(capital_words)
print(capital_text)
# This Is A Test With 10 Words.
numbers = [int(w) for w in words if w[0:1] > '0' and w[0:1] < '9']
print(numbers)
# [10]