Using try and except statement for exception handling, using raise to throw out the exception and stop the program.
The print built-in function displays the specified string to the output.
An if else statement is a conditional statement that runs a different set of statements depending on whether an expression is true or false.
Method 1
The def keyword defines a function. A function is a group of statements that can be called upon repeatedly to perform a specific task.
Write a code or draw a flowchart to show the factorised form of a quadratic expression                     ,  or indicate that it cannot be factorised. The input, b, is a positive integer less than 60. 
A variable stores a value that can be referred to or modified later in the program. A name, output, is assigned to the variable as an identifier in this case.
Method 2
The for loop repeats codes within itself for a fixed number of times determined by the specified expression.
Game Code
def load_input(input_str):    try:     x = int(input(input_str))     if x<0 or x>60:          raise ValueError     else:         return x   except ValueError:     print("Enter positive whole number only!")     raise b = load_input('Enter the value of b: ') c = 60 output = "" for i in range(b):     j = b - i     if i*j == c:         output = "The factorised form is (x + {c1})(x + {c2}).".format(c1=i,c2=j)         break if output == "":      output = "The expression cannot be factorised." print(output)
00:00
def load_input(input_str):    try:     x = int(input(input_str))     if x<0 or x>60:          raise ValueError     else:         return x   except ValueError:     print("Enter positive whole number only!")     raise b = load_input('Enter the value of b: ') c = 60 output = "" for i in range(1,c+1):     if c % i ==0:         j = c // i         if i + j == b:             output = "The factorised form is (x + {c1})(x + {c2})".format(c1=i,c2=j)             break if output == "":      output = "The expression cannot be factorised." print(output)