Created
March 10, 2021 13:43
-
-
Save sertdfyguhi/b96324d11e2eb491c45dd5c4542cc904 to your computer and use it in GitHub Desktop.
programToCamelCaseAPieceOfText
This file contains 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
path = input('File path: ') | |
with open(path, 'r') as f: | |
contents = f.read() | |
contents_list = contents.split(' ') | |
for index, word in enumerate(contents_list): | |
if index == 0: | |
contents_list[index] = word.lower() | |
continue | |
contents_list[index] = word.capitalize() | |
print(''.join(contents_list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment