Help me disperse the boxes.



  • Specify the program below so that it can remove through the gap in one line the meaning of the smallest and most important elements of my_tuple.

    my_tuple = (-214, 181, -139, 448, -664, -66, 213, 832, 717, -462, -924, -706, -85, -244, -222, -340, -482, -518, -781, 759, -593, 905, -354, -377, -141, -742, 383, -381, 109, -639, -480, -810, -686, 892, -612, 696, 993, 791, 631, -493, -218, -829, -275, 619, -628, -241, -565, -835, -69, 747, 711, -252, -811, -407, -153, 904, 933, -254, 307, -493, -419, -109, -543, 155, -127, 613, -452, -459, 856, 562, 333, -66, -77, -598, -779, -278, 867, 321, -20, -415, -357, 735, -906, -14, -370, 453, -630, -736, -830, -917, 32, 422, -895, 198, 284, 472, -986, -964, -73, 29)
    2
    my_tuple = list(my_tuple)
    3
    print(' '.join(map(str,sorted(my_tuple))))
    4
    


    5

    6



  • Well, it's almost right that the code was written, and it's been sorted. All we need to do is pick the first element (it will be the smallest) and the last element (it will be the largest) on the disserted list.

    my_tuple = sorted(my_tuple)
    

    print(my_tuple[0], my_tuple[-1])


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2