Python Day16: Exceptions - String to Integer | HackerRank 30 Days of Code Solutions


 Code:

#!/bin/python3

import sys

S = input().strip()

try: 
    print (int(S))
except ValueError: 
    print ("Bad String")

Post a Comment

Previous Post Next Post
Best Programming Books

Facebook

AJ Facebook
Checkout Our Facebook Page
AJ Blogs
Checkout Our Instagram Page