美文网首页
函数2:try……except……

函数2:try……except……

作者: Iphone60Plus | 来源:发表于2020-03-31 18:49 被阅读0次
    #try……except……:代码错误后执行
    try:
        age = int(input('请输入一个整数:'))
    except Exception:
        print('要输入整数噢')
    # exception是一般错误的集合
    

    相关文章

      网友评论

          本文标题:函数2:try……except……

          本文链接:https://www.haomeiwen.com/subject/cksguhtx.html