Programming/Python & Data Structures
[Baekjoon/Python3] 1076번 저항
HooNeee
2020. 12. 2. 22:51
[Baekjoon/Python3] 1076번 저항
1076번: 저항
첫째 줄에 첫 번째 색, 둘째 줄에 두 번째 색, 셋째 줄에 세 번째 색이 주어진다. 색은 모두 위의 표에 쓰여 있는 색만 주어진다.
www.acmicpc.net
index = { # Dictionary
'black' : 0,
'brown' : 1,
'red' : 2,
'orange' : 3,
'yellow' : 4,
'green' : 5,
'blue' : 6,
'violet' : 7,
'grey' : 8,
'white' : 9
}
A = input()
B = input()
C = input()
res = index.get(A) * 10 + index.get(B)
for i in range(index.get(C)):
res *= 10
print(res)