{"id":26672,"date":"2022-04-02T20:20:07","date_gmt":"2022-04-02T14:50:07","guid":{"rendered":"https:\/\/python-programs.com\/?p=26672"},"modified":"2022-04-02T20:20:07","modified_gmt":"2022-04-02T14:50:07","slug":"how-to-change-case-of-all-characters-in-a-txt-file-in-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/how-to-change-case-of-all-characters-in-a-txt-file-in-python\/","title":{"rendered":"How to Change Case of All Characters in a .txt File in Python"},"content":{"rendered":"

lower() Method:<\/strong><\/p>\n

The lower() method in python returns a string with all characters in lower case. Symbols and numbers are ignored by this method.<\/p>\n

upper() Method:<\/strong><\/p>\n

The upper() method in python returns a string with all characters in the upper case. Symbols and numbers are ignored by this method.<\/p>\n

Let us take a samplefile.txt as an Example here which contains the following content.<\/p>\n

samplefile.txt:<\/strong><\/p>\n

Hello THIS is PYTHON-programs PLATform\r\nGOOd morning All<\/pre>\n

Converting All Characters in a Text File to Uppercase<\/h3>\n

Approach:<\/strong><\/p>\n