Python 数字格式转换
作者:互联网
# 数字格式转换v1
'''a = input()
a1 = list(a)
b = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
for i in range(len(a)):
a1[i] = b[eval(a1[i])]
a2 = ''.join(a1)
print(a2)'''
#NumberConvertv2 '''template = "零一二三四五六七八九" s = input() for c in s: print(template[eval(c)], end="")'''
#numconvertV3 digit = {'0':'零','1':'一','2':'二','3':'三','4':'四','5':'五','6':'六','7':'七','8':'八','9':'九'} f = input() listf = list(f) shu = [] for i in listf: shu.append(digit[i]) jieguo = ''.join(shu) print(jieguo)
#NumberConvertv2 '''template = "零一二三四五六七八九" s = input() for c in s: print(template[eval(c)], end="")'''
#numconvertV3 digit = {'0':'零','1':'一','2':'二','3':'三','4':'四','5':'五','6':'六','7':'七','8':'八','9':'九'} f = input() listf = list(f) shu = [] for i in listf: shu.append(digit[i]) jieguo = ''.join(shu) print(jieguo)
标签:转换,shu,Python,jieguo,a1,template,input,print,格式 来源: https://www.cnblogs.com/xiaoxuesheng993/p/10846090.html