Program to Calculate the Perimeter of a Square for a given Side-length

Program:

class SqrPerimeter:def __init__(self,num):`self.num=num`

def Perimeter(self):if self.num>0:print('Perimeter of Square of a side-length {} is : {}'.format(self.num,4*self.num))`else:`

print('Please enter valid length')if __name__=='__main__':num = float(input('Enter Side-length of a SQUARE :'))obj = SqrPerimeter(num)obj.Perimeter()INPUT:

Enter Side-length of a SQUARE :12.12

OUTPUT :

Perimeter of Square of a side-length 12.12 is : 48.48

## Comments