+ 1
first letters from sentence
How i can get the first letters from sentence in python Ex: input=hello Solo Learn output=h S L Edit : I try For letter in input(): Print(letter[0]) But not work
4 odpowiedzi
+ 2
print(' '.join([i[0] for i in input().split()]))
+ 2
What you tried..? First try it yourself and Post your attempt if you struck between....
0
toufikdz
(Give a reply after Edit to get notified other if you need further solution.)
You are passing total string instead split it and pass list.. Like
and to print in same line, make these change:
for letter in input().split():
print(letter[0],end="")
0
Thank u