Use for, .split(), and if to create a Statement that will print out words that start with 's':

st = 'Print only the words that start with s in this sentence'

2

There are 2 best solutions below

0
eisa.exe On

Split the list into Strings with .split(). Use " " as a separator because you want spaces to separate the words.

st = "Print only the words that start with s in this sentence"
words = []
for word in st.split(" "):
    if word.startswith("s"):
        words.append(word)

print(words)
0
Akash Saha On

Try this instead

st = 'Print only the words that start with s in this sentence'
Answer = [word for word in st.split() if word[0] == 's']
print(Answer)