Skip to content

Commit

Permalink
22.08.06
Browse files Browse the repository at this point in the history
  • Loading branch information
delena0702 authored Aug 6, 2022
1 parent bf3f706 commit 8da5710
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions BAEKJOON/5622_다이얼.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def toNumber(ch):
if ch >= 'A' and ch <= 'C': return 3
if ch >= 'D' and ch <= 'F': return 4
if ch >= 'G' and ch <= 'I': return 5
if ch >= 'J' and ch <= 'L': return 6
if ch >= 'M' and ch <= 'O': return 7
if ch >= 'P' and ch <= 'S': return 8
if ch >= 'T' and ch <= 'V': return 9
if ch >= 'W' and ch <= 'Z': return 10

print(sum(map(toNumber, input())))

0 comments on commit 8da5710

Please sign in to comment.