{"id":3648,"date":"2022-12-01T20:59:01","date_gmt":"2022-12-01T20:59:01","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3648"},"modified":"2022-12-01T20:59:02","modified_gmt":"2022-12-01T20:59:02","slug":"python-string-lower","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/python-string-lower\/","title":{"rendered":"Python String lower() Method With Example"},"content":{"rendered":"<p style=\"text-align: center;\">Python String lower<\/p>\n<p>Now, we are going to learn about the lower method. As the name of the method says, the lower method returns a copy of the string, with the alphabet converted to lowercase. So, whenever we are required to convert the string into lowercase, we can make use of the lower method. Remember that the method returns a new string, and the original string is left as it was. Let\u2019s have a look at a simple program, which demonstrates the same thing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3649 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD.jpg\" alt=\"\" width=\"625\" height=\"106\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD.jpg 625w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-300x51.jpg 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2 style=\"text-align: center;\">Python String lower() Method<\/h2>\n<p>As you can see in the above program, we have a string, in which all the alphabets here are in uppercase. Then we are calling the lower method. This method returns a string, which is assigned to the string2 variable. Then, we printed both strings here. Let\u2019s have a look at the output now.<\/p>\n<p>The original string:\u00a0 GYANIPANDIT<br \/>\nThe string in the uppercase:\u00a0 gyanipandit<\/p>\n<p>As you can see in the output, we have the original string as it was, and then there is a string, in which, the alphabets are converted in lowercase. So, we have got the lowercase string for our string using the lowercase method.<\/p>\n<p>Let\u2019s have a look at another example, with which, we would get a clearer picture of the lower method.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3650 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-1.jpg\" alt=\"\" width=\"642\" height=\"95\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-1.jpg 642w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-1-300x44.jpg 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<p>As you can see in the above program, we have a string, and this time, some of the alphabets are already in lowercase, and some are in uppercase. Then we are again calling the lower method on the string. Again, the lower method returns a string, with the alphabet converted to lowercase. Let\u2019s have a look at the output once.<\/p>\n<p>The original string:\u00a0 gyaniPANDIT<br \/>\nThe string in the uppercase:\u00a0 gyanipandit<\/p>\n<p>As you can see in the above output, the original string was left as it was, and the lower returned the string, with alphabets converted to lowercase.<\/p>\n<p>Now, Let\u2019s consider a case, where we have a string, where not all the characters are alphabets. Let\u2019s have a look at the below program, in which, such a situation is being described.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3651 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-2.jpg\" alt=\"\" width=\"617\" height=\"92\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-2.jpg 617w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-lower-METHOD-2-300x45.jpg 300w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/p>\n<p>As you can see in the above program, we have a string, in which, all the characters are not alphabets. Then, we are calling the lower method. So, even if there are some characters that are not alphabets, we have the string returned from the lower method, with all the alphabets converted to the lowercase. Let\u2019s have a look at the output now.<\/p>\n<p>The original string:\u00a0 GYANIPANDIT123<br \/>\nThe string in the uppercase:\u00a0 gyanipandit123<\/p>\n<p>As you can see in the output, we got the string, with all the alphabets converted to lowercase. So, as and when required, we can make use of the lower method, using which, we get the string, with all the alphabets converted to the lowercase. Remember that the lower method returns a string, and the original string is as it was.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python String lower Now, we are going to learn about the lower method. As the name of the method says, the lower method returns a copy of the string, with the alphabet converted to lowercase. So, whenever we are required to convert the string into lowercase, we can make use of the lower method. Remember [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[26,27],"class_list":{"0":"post-3648","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-python-tutorial","7":"tag-python","8":"tag-python-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=3648"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3648\/revisions"}],"predecessor-version":[{"id":4178,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3648\/revisions\/4178"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}