Errors:

Unusual and unexpected situations that affect the normal flow of program execution. There are Two types of errors in Python:

Exception Handling :

When there is an exception occured in our program, the execution stops and it displays an error message. But if we can handle it, the program will not crash and execution will continue.


Exception Handling using try and except:

Creating our own exception type:

To create our own exception type while create a class we need to inherit Exception class or any other exception class.

To catch this type of exception we can use previous discussed method. (try-except)

	
	class notfellingwell(Exception):
		def __init__(self,temp):
			self.temp = temp
			
		def __str__(self, temp):
			if(self.temp >=38):
				return f'Your body temp is : {self.temp} . Take Rest!!'

	
	
	try:
		raise notfellingwell(40)
	except:
		print("Ignore this temp and enjoy your life!!")