0

Write a single line code in python3. to return list of first letter of each word from given statement.

Statement=" Hello my name is Michael Jackson" I can write that code in three lines minimum.. can anybody help me with that.?? Ans is ['H','m',,'n','i','M','J']

3/30/2020 11:19:59 AM

AMRIT PRASAD PHUYAL

2 Answers

New Answer

+2

You can use list comprehension Statement = "Hello my name is Michael Jackson" print([w[0] for w in Statement.split()])

+1

~ swim ~ that works ... Thank you..🙏🙏