{"id":3460,"date":"2020-07-04T15:08:12","date_gmt":"2020-07-04T09:38:12","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=3460"},"modified":"2024-01-01T14:31:43","modified_gmt":"2024-01-01T09:01:43","slug":"python-uppercase","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-uppercase\/","title":{"rendered":"7 Ways of Making Characters Uppercase Using Python"},"content":{"rendered":"\n<p>The reason why python has become such a popular programming language is that it provides programmers lots and lots of<strong> versatile and standard libraries<\/strong> that are readily available means we don\u2019t even need to install them explicitly. One such library in python is upper(), which converts <strong>strings in python to uppercase.&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>It means if we have a string in lower letters (For example \u2013 \u201d hello, how are you\u201d), we can use upper() to convert it into uppercase letters (\u201cHELLO, HOW ARE YOU\u201d). We will not only know how to turn all the letters to uppercase, but we will also know how to convert Only the First letter and every alternative letter to uppercase.&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#Syntax_of_Making_Characters_Uppercase_Using_Python\" >Syntax&nbsp;of Making Characters Uppercase Using Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#Examples_of_converting_string_in_python_uppercase\" >Examples of converting string in python uppercase<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#1_The_First_Letter_in_the_string_capital_in_Python\" >1. The First Letter in the string capital in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#2_The_First_Letter_of_each_word_Capital_in_Python\" >2. The First Letter of each word Capital&nbsp;in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#3_To_match_if_two_strings_are_the_same\" >3. To match if two strings are the same&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#4_To_check_if_the_String_is_already_in_uppercase_or_not\" >4. To check if the String is already in uppercase or not<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#5_To_make_every_alternative_character_in_uppercase_letters\" >5. To make every alternative character in uppercase letters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#6_Converting_String_to_Python_Uppercase_without_built-in_function\" >6. Converting String to Python Uppercase without built-in function&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#7_Conversion_of_String_from_Python_Uppercase_to_Lowercase\" >7. Conversion of String from Python Uppercase to Lowercase&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#Must_Read\" >Must Read:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-syntax-of-making-characters-uppercase-using-python\"><span class=\"ez-toc-section\" id=\"Syntax_of_Making_Characters_Uppercase_Using_Python\"><\/span>Syntax&nbsp;of Making Characters Uppercase Using Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As upper() is a built-in method we do not even need to import it. We can use it directly like this &#8211;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;hello&quot; \nuppercase_string=string.upper() \nprint(uppercase_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nHELLO&nbsp;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1584\" height=\"436\" src=\"https:\/\/i0.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image.png?fit=1024%2C282&amp;ssl=1\" alt=\"python uppercase\" class=\"wp-image-3461\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image.png 1584w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-300x83.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1024x282.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-768x211.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1536x423.png 1536w\" sizes=\"(max-width: 1584px) 100vw, 1584px\" \/><\/figure>\n\n\n\n<p><strong>Note- It does not take any arguments.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-examples-of-converting-string-in-python-uppercase\"><span class=\"ez-toc-section\" id=\"Examples_of_converting_string_in_python_uppercase\"><\/span>Examples of converting string in python uppercase<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The first letter in the string capital<\/li>\n\n\n\n<li>First letter of each word Capital&nbsp;<\/li>\n\n\n\n<li>To match if two strings are the same&nbsp;<\/li>\n\n\n\n<li>Check if the String is already in uppercase or not<\/li>\n\n\n\n<li>To make every alternative character in uppercase letters<\/li>\n\n\n\n<li>Converting String to Python <a href=\"http:\/\/www.pythonpool.com\/python-casefold\/\">Uppercase<\/a> without built-in function&nbsp;<\/li>\n\n\n\n<li>Conversion of String from Python Uppercase to Lowercase&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-the-first-letter-in-the-string-capital-in-python\"><span class=\"ez-toc-section\" id=\"1_The_First_Letter_in_the_string_capital_in_Python\"><\/span>1. The First Letter in the string capital in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For this purpose, we have a built-in function named capitalize()&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;hello how are you&quot; \nuppercase_string=string.capitalize() \nprint(uppercase_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nHello how are you&nbsp;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"292\" src=\"https:\/\/i0.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1.png?fit=1024%2C189&amp;ssl=1\" alt=\"python uppercase\" class=\"wp-image-3462\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1-300x55.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1-1024x189.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1-768x141.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-1-1536x283.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<p>Sometimes we forget how the function name, so we should also know how to do the same without using these functions.&nbsp;&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;hello how are you&quot; \nnew_string=&quot;&quot; \nfor i in range(len(string)): \n   if i==0: \n        new_string+=string&#x5B;i].upper() \n   else: \n        new_string+=string&#x5B;i] \nprint(new_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nHello how are you&nbsp;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-the-first-letter-of-each-word-capital-in-python\"><span class=\"ez-toc-section\" id=\"2_The_First_Letter_of_each_word_Capital_in_Python\"><\/span>2. The First Letter of each word Capital&nbsp;in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Suppose we want all the words in a string to be uppercase. For this we have a method available in python called<strong> title()<\/strong>.&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;hello how are you&quot; \nuppercase_string=string.title() \nprint(uppercase_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nHello How Are You&nbsp;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"292\" src=\"https:\/\/i1.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2.png?fit=1024%2C189&amp;ssl=1\" alt=\"python uppercase\" class=\"wp-image-3463\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2-300x55.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2-1024x189.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2-768x141.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-2-1536x283.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<p>We can do this without using built-in function \u2013 title() like this-&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;my name is ashwini mandani&quot; \nlist1=string.split(&quot; &quot;) \nfor i in range(len(list1)): \n   list1&#x5B;i]=list1&#x5B;i].capitalize() \nstring=&quot; &quot;.join(list1) \nprint(string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nMy Name Is Ashwini Mandani&nbsp;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-to-match-if-two-strings-are-the-same\"><span class=\"ez-toc-section\" id=\"3_To_match_if_two_strings_are_the_same\"><\/span>3. To match if two strings are the same&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If we want to compare two strings in terms of whether they are same or not (not considering the uppercase and lowercase aspect).&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring1=&quot;thiS iS a STrinG&quot; \nstring2=&quot;ThiS iS a sTrING&quot; \nif string1.upper()==string2.upper(): \n    print(&quot;Both the strings are same&quot;) \nelse: \n    print(&quot;not same&quot;) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nBoth the strings are same&nbsp;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"436\" src=\"https:\/\/i0.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3.png?fit=1024%2C282&amp;ssl=1\" alt=\"To match if two strings are the same\u00a0\" class=\"wp-image-3464\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3-300x82.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3-1024x282.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3-768x211.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-3-1536x422.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-to-check-if-the-string-is-already-in-uppercase-or-not\"><span class=\"ez-toc-section\" id=\"4_To_check_if_the_String_is_already_in_uppercase_or_not\"><\/span>4. To check if the String is already in uppercase or not<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>There are many times when we are taking input from the user and it is not compulsory that every user inputs in the same format. <\/strong>But we need to store the data in the same format, therefore if the string is already in uppercase print \u2018already in upper case\u2019 otherwise convert it into uppercase.&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef string_check(string): \n   if string.isupper(): \n        return(&quot;Already in UpperCase&quot;) \n   else: \n       string=string.upper() \n       return (string) \nprint(string_check(&quot;MY NAME IS ASHWINI&quot;)) \nprint(string_check(&quot;my name is ashwini&quot;)) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nAlready in UpperCase\nMY NAME IS ASHWINI&nbsp;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-to-make-every-alternative-character-in-uppercase-letters\"><span class=\"ez-toc-section\" id=\"5_To_make_every_alternative_character_in_uppercase_letters\"><\/span>5. To make every alternative character in uppercase letters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;every alternative character is in uppercase&quot; \nnew_string=&quot;&quot; \nfor i in range(len(string)): \n   if i%2==0: \n        new_string+=string&#x5B;i].upper() \n   else: \n        new_string+=string&#x5B;i] \nprint(new_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nEvErY AlTeRnAtIvE ChArAcTeR Is iN UpPeRcAsE&nbsp;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-6-converting-string-to-python-uppercase-without-built-in-function\"><span class=\"ez-toc-section\" id=\"6_Converting_String_to_Python_Uppercase_without_built-in_function\"><\/span>6. Converting String to Python Uppercase without built-in function&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We can convert any string into uppercase without using any built-in function. Every character has an <a href=\"https:\/\/en.wikipedia.org\/wiki\/ASCII\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">ASCII<\/a> value. Like \u2018A\u2019 = 65, \u2018B\u2019 = 66, \u2018a\u2019 = 97, \u2018b\u2019 = 98. We can take advantage of this fact and convert lowercase characters to uppercase characters.&nbsp;&nbsp;<\/p>\n\n\n\n<p><strong>Note that, the ASCII value of \u2018A\u2019 &#8211; \u2018Z\u2019 ranges from 65-90 and that of \u2018a\u2019 -\u2019z\u2019 range from 97-122.&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;every charaCter is in uppercase&quot; \nnew_string=&quot;&quot; \nfor i in string: \n   # 'ord' is used to find the ascii value \n   if ord(i) &gt;=97 and ord(i)&lt; 123: \n       #'chr' used to find the character from ascii value \n        new_string+=chr(ord(i)-32) \n   else: \n        new_string+=i \nprint(new_string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nEVERY CHARACTER IS IN UPPERCASE&nbsp;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"628\" src=\"https:\/\/i1.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5.png?fit=1024%2C405&amp;ssl=1\" alt=\"Converting String to Python Uppercase without built-in function\" class=\"wp-image-3466\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5-300x119.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5-1024x405.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5-768x304.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-5-1536x608.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-7-conversion-of-string-from-python-uppercase-to-lowercase\"><span class=\"ez-toc-section\" id=\"7_Conversion_of_String_from_Python_Uppercase_to_Lowercase\"><\/span>7. Conversion of String from Python Uppercase to Lowercase&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python also provides some counterparts of its upper() and isupper() methods. In Python uppercase characters can be converted into lowercase using lower().&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nstring=&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot; \nstring=string.lower() \nprint(string) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nabcdefghijklmnopqrstuvwxyz&nbsp;<\/pre>\n\n\n\n<p>Similarly, if we want to check if the string is already in lowercase or not<strong> we use islower().&nbsp;<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nprint('abcdefghijklmnopqrstuvwxyz'.islower()) \n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-&nbsp;\nTrue&nbsp;<\/pre>\n\n\n\n<p>Every other functionality works same for lower() as we have discussed in upper().&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-red-color has-text-color\" id=\"h-must-read\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/www.pythonpool.com\/python-lowercase\/\">How to Convert String to Lowercase in<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/square-root-in-python\/\">How to Calculate Square Root<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-user-input\/\">User Input | Input () Function | Keyboard Input<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-book\/\">Best Book to Learn Python<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python built-in functions provide a way to convert String in <strong>python from uppercase<\/strong> to lowercase and vice versa. Generally, when we want to keep all the text data in the same format (uppercase or lowercase), we use these methods.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Try to run the programs on your side and let me know if you have any queries.<\/p>\n\n\n\n<p><strong><em>Happy Coding!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The reason why python has become such a popular programming language is that it provides programmers lots and lots of versatile and standard libraries that &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"7 Ways of Making Characters Uppercase Using Python\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/#more-3460\" aria-label=\"More on 7 Ways of Making Characters Uppercase Using Python\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":3489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[1345,595,1327,1343,1346,1328,1342,1338,1340,1341,1330,1337,1333,1329,1324,1326,1335,1331,1339,1344,1325,1336,1334,1332],"class_list":["post-3460","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-convert-string-to-uppercase-python","tag-convert-uppercase-to-lowercase-python","tag-create-variable-using-camelcase-laddercase-and-uppercase-in-python","tag-how-to-print-uppercase-in-python","tag-how-to-uppercase-in-python","tag-python-check-if-uppercase","tag-python-convert-string-to-uppercase","tag-python-convert-to-uppercase","tag-python-is-uppercase","tag-python-make-string-uppercase","tag-python-make-uppercase","tag-python-string-to-uppercase","tag-python-string-uppercase","tag-python-to-uppercase","tag-python-uppercase","tag-python-uppercase-first-letter","tag-python-uppercase-function","tag-python-uppercase-string","tag-string-to-uppercase-python","tag-string-uppercase-python","tag-to-uppercase-python","tag-uppercase-in-python","tag-uppercase-python","tag-uppercase-string-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>7 Ways of Making Characters Uppercase Using Python - Python Pool<\/title>\n<meta name=\"description\" content=\"To convert strings in python to uppercase or vice versa there is an upper(). And to check whether a string is in uppercase isupper() is used.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-uppercase\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"7 Ways of Making Characters Uppercase Using Python\" \/>\n<meta property=\"og:description\" content=\"The reason why python has become such a popular programming language is that it provides programmers lots and lots of versatile and standard libraries\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-uppercase\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-04T09:38:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T09:01:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"999\" \/>\n\t<meta property=\"og:image:height\" content=\"604\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashwini Mandani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashwini Mandani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/\"},\"author\":{\"name\":\"Ashwini Mandani\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\"},\"headline\":\"7 Ways of Making Characters Uppercase Using Python\",\"datePublished\":\"2020-07-04T09:38:12+00:00\",\"dateModified\":\"2024-01-01T09:01:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/\"},\"wordCount\":644,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg\",\"keywords\":[\"convert string to uppercase python\",\"convert uppercase to lowercase python\",\"create variable using camelcase laddercase and uppercase. in python\",\"how to print uppercase in python\",\"how to uppercase in python\",\"python check if uppercase\",\"python convert string to uppercase\",\"python convert to uppercase\",\"python is uppercase\",\"python make string uppercase\",\"python make uppercase\",\"python string to uppercase\",\"python string uppercase\",\"python to uppercase\",\"python uppercase\",\"python uppercase first letter\",\"python uppercase function\",\"python uppercase string\",\"string to uppercase python\",\"string uppercase python\",\"to uppercase python\",\"uppercase in python\",\"uppercase python\",\"uppercase string python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-uppercase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-uppercase\/\",\"name\":\"7 Ways of Making Characters Uppercase Using Python - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg\",\"datePublished\":\"2020-07-04T09:38:12+00:00\",\"dateModified\":\"2024-01-01T09:01:43+00:00\",\"description\":\"To convert strings in python to uppercase or vice versa there is an upper(). And to check whether a string is in uppercase isupper() is used.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-uppercase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg\",\"width\":999,\"height\":604,\"caption\":\"python uppercase\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-uppercase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"7 Ways of Making Characters Uppercase Using Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\",\"name\":\"Ashwini Mandani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"caption\":\"Ashwini Mandani\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"7 Ways of Making Characters Uppercase Using Python - Python Pool","description":"To convert strings in python to uppercase or vice versa there is an upper(). And to check whether a string is in uppercase isupper() is used.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/python-uppercase\/","og_locale":"en_US","og_type":"article","og_title":"7 Ways of Making Characters Uppercase Using Python","og_description":"The reason why python has become such a popular programming language is that it provides programmers lots and lots of versatile and standard libraries","og_url":"https:\/\/www.pythonpool.com\/python-uppercase\/","og_site_name":"Python Pool","article_published_time":"2020-07-04T09:38:12+00:00","article_modified_time":"2024-01-01T09:01:43+00:00","og_image":[{"width":999,"height":604,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg","type":"image\/jpeg"}],"author":"Ashwini Mandani","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Ashwini Mandani","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/"},"author":{"name":"Ashwini Mandani","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056"},"headline":"7 Ways of Making Characters Uppercase Using Python","datePublished":"2020-07-04T09:38:12+00:00","dateModified":"2024-01-01T09:01:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/"},"wordCount":644,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg","keywords":["convert string to uppercase python","convert uppercase to lowercase python","create variable using camelcase laddercase and uppercase. in python","how to print uppercase in python","how to uppercase in python","python check if uppercase","python convert string to uppercase","python convert to uppercase","python is uppercase","python make string uppercase","python make uppercase","python string to uppercase","python string uppercase","python to uppercase","python uppercase","python uppercase first letter","python uppercase function","python uppercase string","string to uppercase python","string uppercase python","to uppercase python","uppercase in python","uppercase python","uppercase string python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-uppercase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-uppercase\/","url":"https:\/\/www.pythonpool.com\/python-uppercase\/","name":"7 Ways of Making Characters Uppercase Using Python - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg","datePublished":"2020-07-04T09:38:12+00:00","dateModified":"2024-01-01T09:01:43+00:00","description":"To convert strings in python to uppercase or vice versa there is an upper(). And to check whether a string is in uppercase isupper() is used.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-uppercase\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-3.jpg","width":999,"height":604,"caption":"python uppercase"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-uppercase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"7 Ways of Making Characters Uppercase Using Python"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056","name":"Ashwini Mandani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","caption":"Ashwini Mandani"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=3460"}],"version-history":[{"count":13,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3460\/revisions"}],"predecessor-version":[{"id":31523,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3460\/revisions\/31523"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/3489"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=3460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=3460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=3460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}