I'm trying to make a program that takes any sentence and outputs that same sentence with all the first letters of the words being capitalized. There are exceptions: "and" "not" "the" must be all lowercase as well as any two lettered words.
For example, a string that says 'My name is Mary, not Sally' would output:"my Name is Mary, not Sally".
My strategy is to turn any string into a list of the words and manipulate any exceptions, then add them to the list and put it back to a string again. If there is a more efficient way please let me know.
Screenshots(my progress so far):
https://gyazo.com/20c7af2af42a87d492ef12a31678b657 <-----code
https://i.gyazo.com/a67252ce672d110ca260...fbbea3.png <----output in shell
For example, a string that says 'My name is Mary, not Sally' would output:"my Name is Mary, not Sally".
My strategy is to turn any string into a list of the words and manipulate any exceptions, then add them to the list and put it back to a string again. If there is a more efficient way please let me know.
Screenshots(my progress so far):
https://gyazo.com/20c7af2af42a87d492ef12a31678b657 <-----code
https://i.gyazo.com/a67252ce672d110ca260...fbbea3.png <----output in shell