Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Follow publication

Member-only story

Exception Handling in Python

Renu Khandelwal
Level Up Coding
Published in
5 min readMar 8, 2020

Photo by Jan Genge on Unsplash
Code without exception handler and code with the exception handler

Try and Except block in the exception handler

try:
f= open("a.csv", "r")
data=f.read()
print(data)
except:
print("Some error")

The finally block in the exception handler

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Renu Khandelwal

A Technology Enthusiast who constantly seeks out new challenges by exploring cutting-edge technologies to make the world a better place!

No responses yet

Write a response