Hex to Decimal
Python
Medium
3 views
Problem Description
Hex string h is provided (without 0x). Convert it to decimal integer and output it.
Input Format
One string h.
Output Format
One integer.
Official Solution
import sys
h=sys.stdin.read().strip()
if not h: sys.exit(0)
sys.stdout.write(str(int(h,16)))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!