Day 16: Exceptions - String to Integer

  • + 2 comments

    They need to change how to evalute this problem

    Fail

    #!/bin/python3
    
    import sys
    
    if __name__ == "__main__":
        S = input()
        try :
            print(int(S))
        except ValueError :
            print("Bad String")
    

    Pass

    #!/bin/python3
    
    import sys
    
    S = input()
    try :
        print(int(S))
    except ValueError :
        print("Bad String")