for, this code below: (Indented to output max and min value from the given input, which ends and prints the values on typing done and handle exception for string inputs)