Convert to Uppercase
Convert to Uppercase
EasyStrings75% accepted
Given a lowercase string, convert all its characters to uppercase and print the result. Each lowercase letter 'a'-'z' can be converted to 'A'-'Z' by subtracting 32 from its ASCII value. This introduces you to character encoding and ASCII arithmetic.
Approach
Given a string S containing only lowercase letters, print S in uppercase.
Input
hello
Output
HELLO
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards