Learn Python EXCEPTION HANDLING in 5 minutes! 🚦

# exception = An event that interrupts the flow of a program # (ZeroDivisionError, TypeError, ValueError) # 1.try, 2.except, 3.finall...

Learn Python EXCEPTION HANDLING in 5 minutes! 🚦
Bro Code
134.5K views β€’ Jun 29, 2024
Learn Python EXCEPTION HANDLING in 5 minutes! 🚦

About this video

# exception = An event that interrupts the flow of a program
# (ZeroDivisionError, TypeError, ValueError)
# 1.try, 2.except, 3.finally

try:
number = int(input("Enter a number: "))
print(1 / number)
except ZeroDivisionError:
print("You can't divide by zero IDIOT!")
except ValueError:
print("Enter only numbers please!")
except Exception:
print("Something went wrong!")
finally:
print("Do some cleanup here")

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

134.5K

Likes

4.0K

Duration

5:49

Published

Jun 29, 2024

User Reviews

4.7
(26)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.

No specific trending topics match this video yet.

Explore All Trends