How to print the last letter of every word in a string in Python

1 Answer

0 votes
s = "Python is an interpreted general purpose programming language"
 
for word in s.split():
    print(word[len(word) - 1])

 


     
'''
run:
     
n
s
n
d
l
e
g
e
 
'''

 



answered Nov 2, 2021 by avibootz

Related questions

...