lowercase to uppercase in python

python program to get a String and convert the lower case characters to upper case Characters

Sample Input 1 :

Hello

Sample Output 1 :

HELLO

Program or Solution

				
			
					
			
				
			

Program Explanation

unicode / ascii_val of lower case alphabets are from 97 to 122 unicode / ascii_val of upper case alphabets are from 65 to 90 so the difference between lower case and uppercase alphabets is 32.

use ord() method to find ascii_val of a character.

Use chr() method to find character of ascii value Note: String is immutable, so you cannot modify a character directly in a orginal string.


Tech Events

Hackathon