{"id":24617,"date":"2021-10-23T09:09:50","date_gmt":"2021-10-23T03:39:50","guid":{"rendered":"https:\/\/python-programs.com\/?p=24617"},"modified":"2021-11-05T19:14:32","modified_gmt":"2021-11-05T13:44:32","slug":"python-string-isupper-method-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-string-isupper-method-examples\/","title":{"rendered":"Python String isupper() Method with Examples"},"content":{"rendered":"
In the previous article, we have discussed Python String istitle() Method Examples<\/a> The string isupper() method determines whether all characters in a string are uppercased.<\/p>\n Syntax:<\/strong><\/p>\n Parameters: <\/strong>This function has no parameters.<\/p>\n Return Value:<\/strong><\/p>\n The isupper() method gives:<\/p>\n Examples:<\/strong><\/p>\n Example1:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Example2:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Go through our tutorial and learn about various Python String Method Examples<\/a> and learn how to apply the knowledge while dealing with strings.<\/p>\n In the previous article, we have discussed Python String istitle() Method Examples isupper() Method in Python: The string isupper() method determines whether all characters in a string are uppercased. Syntax: string.isupper() Parameters: This function has no parameters. Return Value: The isupper() method gives: True if all of the characters in a string are uppercase. If …<\/p>\n
\nisupper() Method in Python:<\/strong><\/p>\nstring.isupper()<\/pre>\n
\n
Given string = 'Welcome To Python-programs'\r\nGiven string = '1234 HELLO ALL @'\r\nGiven string = 'GOOD MORNING BTECHGEEKS'<\/pre>\n
The given string = Welcome To Python-programs\r\nChecking if the given string has all uppercase characters or not = False\r\nThe given string = 1234 HELLO ALL @\r\nChecking if the given string has all uppercase characters or not = True\r\nThe given string = GOOD MORNING BTECHGEEKS\r\nChecking if the given string has all uppercase characters or not = True<\/pre>\n
Given string = 'HELLO THIS IS BTECH_GEEKS'\r\nGiven string = 'ThIs IS a PYThon learning PLATform'\r\nGiven string = '#### HELLO EVERYONE ##%%$12346'<\/pre>\n
The given string = HELLO THIS IS BTECH_GEEKS\r\nChecking if the given string has all uppercase characters or not = True\r\nThe given string = ThIs IS a PYThon learning PLATform\r\nChecking if the given string has all uppercase characters or not = False\r\nThe given string = #### HELLO EVERYONE ##%%$12346\r\nChecking if the given string has all uppercase characters or not = True<\/pre>\n
String isupper() Method Examples in Python<\/h2>\n
\n
Method #1: Using Built-in Functions (Static Input)<\/h3>\n
\n
# Give the string as static input and store it in a variable.\r\ngvn_strng1 = 'Welcome To Python-programs'\r\n# Apply isupper() function to the given string that returns true if all\r\n# of the characters in a given string are uppercase. If any of the characters\r\n# in a string are lowercase, this function returns false.\r\n# Store it in another variable.\r\nrslt_1 = gvn_strng1.isupper()\r\n# Print the above-given String.\r\nprint(\"The given string = \", gvn_strng1)\r\n# Print the result after checking if the given string has all uppercase\r\n# characters or not.\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_1)\r\n# Similarly, do the same for other strings and print the result.\r\ngvn_strng2 = '1234 HELLO ALL @'\r\nrslt_2 = gvn_strng2.isupper()\r\nprint(\"The given string = \", gvn_strng2)\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_2)\r\n\r\ngvn_strng3 = 'GOOD MORNING BTECHGEEKS'\r\nrslt_3 = gvn_strng3.isupper()\r\nprint(\"The given string = \", gvn_strng3)\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_3)\r\n<\/pre>\n
The given string = Welcome To Python-programs\r\nChecking if the given string has all uppercase characters or not = False\r\nThe given string = 1234 HELLO ALL @\r\nChecking if the given string has all uppercase characters or not = True\r\nThe given string = GOOD MORNING BTECHGEEKS\r\nChecking if the given string has all uppercase characters or not = True<\/pre>\n
Method #2: Using Built-in Functions (User Input)<\/h3>\n
\n
# Give the string as user input using the input() function and store it in a variable.\r\ngvn_strng1 = input(\"Enter some Random String = \")\r\n# Apply isupper() function to the given string that returns true if all\r\n# of the characters in a given string are uppercase. If any of the characters\r\n# in a string are lowercase, this function returns false.\r\n# Store it in another variable.\r\nrslt_1 = gvn_strng1.isupper()\r\n# Print the above-given String.\r\nprint(\"The given string = \", gvn_strng1)\r\n# Print the result after checking if the given string has all uppercase\r\n# characters or not.\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_1)\r\n# Similarly, do the same for other strings and print the result.\r\ngvn_strng2 = input(\"Enter some Random String = \")\r\nrslt_2 = gvn_strng2.isupper()\r\nprint(\"The given string = \", gvn_strng2)\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_2)\r\n\r\ngvn_strng3 = input(\"Enter some Random String = \")\r\nrslt_3 = gvn_strng3.isupper()\r\nprint(\"The given string = \", gvn_strng3)\r\nprint(\"Checking if the given string has all uppercase characters or not = \", rslt_3)\r\n\r\n<\/pre>\n
Enter some Random String = HELLO THIS IS BTECH_GEEKS\r\nThe given string = HELLO THIS IS BTECH_GEEKS\r\nChecking if the given string has all uppercase characters or not = True\r\nEnter some Random String = THis is A PYTHON LEARNING PLATform\r\nThe given string = THis is A PYTHON LEARNING PLATform\r\nChecking if the given string has all uppercase characters or not = False\r\nEnter some Random String = #### HELLO EVERYONE #@@#5678\r\nThe given string = #### HELLO EVERYONE #@@#5678\r\nChecking if the given string has all uppercase characters or not = True<\/pre>\n
\n