Python Problems and Solutions

From rbachwiki
Revision as of 21:17, 2 February 2019 by Bacchas (talk | contribs)
Jump to navigation Jump to search
st = 'Print only the words that start with s in this sentence'
for word in st.split():
    if word[0].lower()== 's':
     print(word)

Use Range() to print all even numbers from 0 to 10

for num in range(0,11,2):
  print(num)