Markynsai Markynsai
  • 02-03-2021
  • Computers and Technology
contestada

Need help with a program to search to sort elements in an array.(increasing or decreasing order)

Respuesta :

60002135330 60002135330
  • 02-03-2021

This is for Python

numbers = [7, 3, 6, 9, 0]

print(numbers.sort())

Output: [0, 3, 6, 7, 9]

numbers = [7, 3, 6, 9, 0]

print(numbers.sort(reverse = True))

Output: [9, 7, 6, 3, 0]

Answer Link

Otras preguntas

25. Why does snow and ice linger on the ground longer on the north side of a home or building
What is the density of a substance that has a mass of 55.4 g and a volume of 10 cm3?
Question 1 with 1 blank Todavía no lo hemos investigado. ¿Qué dijimos nosotros? Question 2 with 1 blank El astrónomo rompió el telescopio. ¿Por qué no podía ver
What is the sum of 12 plus 34
A confined aquifer has a specific storage of 2.4 x 10-S ft and a thickness of 300 ft. How much water (in acre-ft) would it yield if the water declined 4.8 ft un
which pairs of points would result in a line with a rate of change of 2:1? select all that apply
First blank A. Behavioral B. Functional C. Structural Sec blank A. Behavioral B. Functional C. Structural
fluorine has seven electrons in its outermost shell. it will most likely try to join an atom with
What is the name of the group of proteins that can reduce the activation energy for metabolic reactions in the cell? enzymes carbohydrates substrates proteins
What term refers to the feeling that is associated with a word? association connotation denotation demonstrative