raising exceptions to raise your exceptions from your own methods you need to use raise keyword like this raise exceptionclass('some text here'let' take an example def enterage(age)if age< raise valueerror('only positive integers are allowed'if age == print('entered age is even'elseprint('entered age is odd'trynum int(input('enter your age')enterage(numexcept valueerrorprint('only positive integers are allowed'run the program and enter positive integer expected output enter your age entered age is even but when we try to enter negative number we getexpected output enter your age- only positive integers are allowed