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

What is the eighth term in the sequence 4, 8, 12, 16, 20…?
find the words that are closest in the following definition with many hill​
Identify the theme of Audre lorde poem "" Fourth of July""
Write essay studying abroad is waste of time and money. To what extent do you agree with this statement
Yet another calculus question :)Given [tex]y = x^3 - 2x[/tex] for [tex]x \geq 0[/tex], find the equation of the tangent line to y where the absolute value of th
Identify the reflection rule in the given figure. A. Reflection along the line y = –1 B. Reflection along x-axis C. Reflection along y = 1 D. Reflection along y
What is meant by social problem?​
What is the difference between hacking and cracking
On a unit circle, the terminal point of 0 is (square root of 2/2, square root of 2/2) what is 0?
What can you determine about Steve’s relationship with his parents by analyzing his parents’ actions? Steve’s father is angry with him. Steve’s mother is nervo