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

How is the underlined gerund used in the sentence? Her hobby in the springtime is gardening.
In which one of the following sentences is the apostrophe used correctly? A. The train began it's journey across country. B. I put the letter back into it's fi
If 3 pieces of candy cost $2.10,how much would four pieces cost?
Which is a function of the plant cell wall? A. It keeps the cell dry. B. It gives the cell its color. C. It prevents the cell from bursting. D. It holds the cel
What is the sum of 3/8 and 1/16? A. 1/4 B. 1/6 C. 4/24 D. 7/16
Solve the system of equations. y = 7x + 43 y = 2x + 13
The ____________ of the Supreme Court presides over oral arguments, influences the direction of discussions, and decides which cases the Court will hear. a. Pr
The repeating pattern of a mineral’s particles forms a solid called a(n) a. crystal. b. element. c. compound. d. rock.
Ricardo has read 2/3 of a book. Lin had read 2/4 of the same book. Who read more of the book?
As farmers use the land, it often changes from arable land to desert. This process is known as A. farmification. B. desertification. C. deforestation. D. lan