def isdigit(x):
if "0" <= x <= "9":
return True
else:
return False
d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = "1*8%6$3@0#19&0"
ans = ""
t = 0
for i in s:
if isdigit(i):
t = t * 10 + int(i)
ans += d[t]
print(ans)
运行该程序段,输出结果是。
微信扫码预览、分享更方便