Print First Letter of Each Word in a String in Python (Keep Punctuation Marks) -


first post site apologize if wrong. have looked appropriate answer, not find one.

i new python , have been playing around trying take long string (passage in book,) , printing first letter of each word while keeping punctuation marks (though not apostrophe marks.) , have been unsuccessful far.

example:

input = "hello, i'm writing sentence. (though not one.)" 

code....

output = h, w s. (t n g o.) 

--note ",", ".", "()", not " ' ".

any tips? thank taking time look

to on adventure, i'll give step-by-step logic of it

in python first use .split() seperate spaces

go through each string in list

go through every char in string

print punctuation marks specify , first alphabetical character find


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -