In this tutorial, learn how to change string to uppercase in Python. The short answer is: use the Python upper() function to convert a string to an uppercase character. Make each letter of a string to uppercase and create a new string with all character in uppercase.
The uppercase makes all the letters in a capital case format. Somewhere in your programming, you may want to get uppercase letters in the output. Python provides a simple function to convert each character to uppercase.
How to Change String to Uppercase Characters Using Python
If you want to convert each and every character of the string to capital. You have to use the Python function
upper() which makes all letters uppercase. You may also like to learn how to convert all string to lowercase in Python.
mylStr = "What are you doing here?";
The above example showing the output with all the letters in uppercase. However, if you have all the letter in uppercase.
You can also want to convert the first letter of each word to uppercase. It is the camel case method where you have to make start letter of each word capitalized. Python does not provide any other functions to convert letters of each word to the capital letter.
You may also like to read
- How to create a string variable in Python
- Access string character by index using Python
- Combine two string variables in Python
Hope, you like this post of how to change string to uppercase characters using python. If you have any query regarding the tutorial, please comment below.
- Programiz Tutorial on upper() in Python
- Stackoveflow Discussion on String Conversion to Uppercase in Python
- Geeksforgeeks Tutorial on variaous upper and lowercase functions in Python
Also tell me, which method you are using to convert the lowercase string to uppercase in Python.