Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ventsislav-Yordanov/bf3c8b60f8eb77ae1df0ae453848708d to your computer and use it in GitHub Desktop.
Save Ventsislav-Yordanov/bf3c8b60f8eb77ae1df0ae453848708d to your computer and use it in GitHub Desktop.
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