Character Code
Python
Easy
2 views
Problem Description
One character ch is provided. Output its ASCII/Unicode code using ord().
Input Format
One character.
Output Format
One integer code.
Constraints
Input length >= 1.
Official Solution
import sys
s=sys.stdin.read()
if not s: sys.exit(0)
ch=s.strip()[:1]
if not ch: sys.exit(0)
sys.stdout.write(str(ord(ch)))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!