3.30

作者: MecZhang | 来源:发表于2017-03-30 15:06 被阅读0次
    while True:
        try:
            num1 = int(input('the first num:'))
            num2 = int(input('the second num'))
            result = num1 / num2
        except Exception as err:
            print(err)
        else:
            break                   #用以跳出循环,灭有异常测跳出循环
        #finally:
           # f.close()
            
            #上下文管理器
            #with
    
    def trans(n):
        if(n>=2):
            trans(n//2)
        print(n%2,end='')
        
    p=trans(34)
    
    #end = ''
    #连续输出
    

    相关文章

      网友评论

          本文标题:3.30

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