Answers for "try for loop python"

0

try for loop python

try:   
    with open('sample.txt','r') as file:
        for line in file:
            (some action here)
except IOError:
    except IOError as (errno, strerror):
        print "I/O error({0}): {1}".format(errno, strerror)
Posted by: Guest on February-12-2021

Python Answers by Framework

Browse Popular Code Answers by Language