数字形式转换

描述:

获得用户输入的一个正整数输入,输出该数字对应的中文字符表示。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬

0到9对应的中文字符分别是:零一二三四五六七八九
解答代码:

#NumberConvert.py
template = "零一二三四五六七八九"
s = input()
for c in s:
    print(template[eval(c)], end="")

猜你喜欢

转载自blog.csdn.net/qq_36406673/article/details/89405605