+ 1
A python program where user will enter sentences and your system displays all the words starting from alphabet 'a'
can some one plssss help me by making me understand the logic behind the code. https://code.sololearn.com/cUd8O2sY28sD/?ref=app
6 Réponses
+ 2
Please include the code you're talking about.
+ 2
I think you want to write a program that
- takes user input as a string
- splits the string into separate words
- sorts the words alphabetically?
+ 2
You can split the input into separate words with s.split(). Then you can use .startswith() to check if a word starts with 'a'. Pack those words in a list, count them, done.
+ 1
Diego Acero done
+ 1
Anna but my problem is that user will enter a sentence of several words and the program needs to count and output the number of words starting from letter "a".
thanx
0
https://code.sololearn.com/ct0kuO5deVxw/?ref=app
Anna i have tried ur way but my code is not working. plz help me