Discuss / Python / 错误处理 作业

错误处理 作业

Topic source
def str2num(s):
    try:
        return int(s)
    except:
        return float(s)

本来直接想把int改成float的,想了想还是用本节课学的内容吧...


  • 1

Reply