''' Purpose: print three integer inputs i1, i2, i3 in sorted order o1, o2, o3 ''' # get numbers reply = input( 'Enter three numbers: ' ) i1, i2, i3 = reply.split() i1 = int( i1 ) i2 = int( i2 ) i3 = int( i3 ) # determine their sorted order. there are six possibilities if ( i1 <= i2 <= i3 ) : # possibility 1 o1 , o2, o3 = i1, i2, i3 elif ( i1 <= i3 <= i2 ) : # possibility 2 o1, o2, o3 = i1, i3, i2 elif ( i2 <= i1 <= i3 ) : # possibility 3 o1, o2, o3 = i2, i1, i3 elif ( i2 <= i3 <= i1 ) : # possibility 4 o1, o2, o3 = i2, i3, i1 elif ( i3 <= i1 <= i2 ) : # possibility 5 o1, o2, o3 = i3, i1, i2 else : # i3 <= i2 <= i1 # must be possibility 6 o1, o2, o3 = i3, i2, i1 # print the sorted order print( o1, o2, o3 ) # all done