You are on page 1of 2

#17709A0501

#finding min and max of list

a=[1,3,5,7,8,9]

print(min(a))

print(max(a))

output:

#17709A0501

#python program for user own exception..

class B(Exception):

def __init__ (self,n1,val):

self.n1=n1;

self.val=val

try:

def valid(self):

n=len(self.val)

if n>10:

pass

else:

print("\n Length is less than 10")

except Exception as me:

print(me)

finally:

print("\n End of the program")


d=B(10,'abc')

d.valid()

output:

End of the program

Length is less than 10

You might also like