代码:
two_digit_number = input()
yellow = int(two_digit_number)
print(type(yellow))
print(str(yellow[1]))
错误信息:
<class 'int'>
Traceback (most recent call last):
File "main.py", line 8, in <module>
print(str(yellow[1]))
TypeError: 'int' object is not subscriptable
我的期望是什么?
如果输入是34,输出应该是7,因为3加上4的和是7。