GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — Python String upper() Method - GeeksforGeeks Python String upper() MethodLast Updated : 26 Apr, 2025 upper() method in Python is a built-in string method that converts all lowercase letters in a string to uppercase. This method is simple to use and does not modify the original string; instead, it returns a new string with the modifications applied. Example:
Output LEARN PYTHON WITH GFG! Explanation:
Syntax of upper() method
Parameters:
Return Type: This method returns a new string in which all lowercase characters in the original string are converted to uppercase. If the original string has no lowercase letters then it returns the string unchanged. Example of upper() method1. Standardizing case for comparisonLet's consider a scenario where we want to compare two strings without considering their case. The upper() method can help us standardize both strings to uppercase before comparison.
Output True Explanation
2. Handling mixed-case stringsupper() method is also very useful when we have a string with a mix of lowercase and uppercase letters, and we want to convert all characters to uppercase.
Output PYTHON IS FUN Explanation
Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |