Im starting to learn Python and programming in general. While doing a statements assessment test, I ran into a syntax problem that has no sense to me. I get a syntax error in the second for.
Thank you!
st = 'Print only the words that start with s in this sentence'
listst = st.split()
for word in listst:
if word[0] == 's':
print(word)
#in one sentence?
startwiths = [word if word[0] == 's' for word in listst]