Created
February 19, 2019 20:51
-
-
Save Ventsislav-Yordanov/bf3c8b60f8eb77ae1df0ae453848708d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def capitalize_sentences(sentences): | |
result = sentences.copy() | |
for index, item in enumerate(result): | |
result[index] = item.capitalize() | |
return result | |
sentences = ["this is test sentence", "I love Python", "positive thinking is nice!"] | |
print("Before calling the function:", sentences) | |
capitalized_sentences = capitalize_sentences(sentences) | |
print("After calling the function:", sentences) | |
print("Capitalized sentences (result of the function):", capitalized_sentences) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment