(prompt:str)
| 1 | def get_valid_side(prompt:str): |
| 2 | while True: |
| 3 | try: |
| 4 | value = float(input(prompt)) |
| 5 | if value <=0: |
| 6 | print("Side must be positive") |
| 7 | continue |
| 8 | return value |
| 9 | except ValueError: |
| 10 | print("Invalid Input") |
| 11 | |
| 12 | |
| 13 | a = get_valid_side("Enter side 1: ") |