User Rating: 0 / 5

If09. Given two variables of real type: A, B. Redistribute the values of these variables so that A is the smaller of the values, and B is the larger. Output new values of variables A and B.

Solution in Python 3:

import randomA = random.randrange(-3,3)B = random.randrange(-3,3)print("Number A:", A)print("Number B:", B)if A > B:    A,B = B,Aprint("Number A:", A)print("Number B:", B)