python长度转换

python长度转换s=input()
if s[-1:] in ['m']:
    s=eval(s[0:-1])*39.37
    print("{:.3f}in".format(s))
elif s[-2:] in ['in']:
    s=eval(s[0:-2])/39.37
    print("{:.3f}m".format(s))
else:
    print("输入错误")

相关文章:

  • 2021-07-24
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-09-23
猜你喜欢
  • 2022-12-23
  • 2021-04-17
  • 2022-01-24
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案