Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 10, 2020 07:42
Show Gist options
  • Save uncoded-ro/f3d02de7b2acfd76f535f30e6e2c89f1 to your computer and use it in GitHub Desktop.
Save uncoded-ro/f3d02de7b2acfd76f535f30e6e2c89f1 to your computer and use it in GitHub Desktop.
try:
f = open('fisier.txt', 'r')
except IOError:
print("Fisierul nu exista!")
else:
print("Fisierul a fost identificat!")
print("Acesta are {} linii.".format(len(f.readlines())))
f.close()
finally:
print("Secventa finalizata!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment