To Uppercase

Easy · rating 850 · strings

Read a line and print it with every letter converted to uppercase.

Editorial

To Uppercase converts every letter in a line to uppercase while leaving digits and punctuation untouched — a one-liner with a built-in, or a manual map subtracting the ASCII case offset (32) from lowercase letters.

print(line.upper())

Complexity

Time: O(n). Space: O(n).

Open To Uppercase in Code Arena →