def rectangle_calculator(question): error = "Please enter an number higher than 0" while True: try: side = float(input(question)) if side > 0: return side else: print(error) except ValueError: print(error) long_length=rectangle_calculator("enter the size of your long side: ") short_length=rectangle_calculator("enter the size of your short side: ") area=(long_length*short_length) perimeter=(long_length+long_length+short_length+short_length) if long_length < short_length: print("Your short side can not be greater than the long side") else: print(f"The area of the square is: {area}") print(f"The perimeter of the square is: {perimeter}")