def square_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) length=square_calculator("enter the size of your side: ") area=(length*length) perimeter=(length+length+length+length) print(f"The area of the square is: {area}") print(f"The perimeter of the square is: {perimeter}")