How to print the first 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[0])

 


     
'''
run:
     
P
i
a
i
g
p
p
l
 
'''

 



answered Nov 2, 2021 by avibootz
...