using python3 I need to accomplish the following.
Example string/list:
“Africa, Asia, Bolivia, Columbia, Connecticut, Delaware, Egypt, Finland, Germany, Haiti, India, London, Poland, Vietnam, zebra, Boston, California, Mississippi, Russia, vacation”
I need to retrieve the first set of words starting with A-Z. I don’t want anything after the first set.
In the example, the result would be: “ Africa, Asia, Bolivia, Columbia, Connecticut, Delaware, Egypt, Finland, Germany, Haiti, India, London, Poland, Vietnam, zebra”
Sometimes the list will be shorter starting with b or c words, but if a word starts with a character which has already been retrieved, that is where the result should stop.
I hope this is clear enough for someone to assist with. Thank you all I’m advance for your help!!
source https://stackoverflow.com/questions/69317692/retrieve-first-set-of-strings-starting-with-a-z
Comments
Post a Comment