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 do you make decisions when you deal with ethical issues?
What election takes place before the general election
The practice of counting slaves as fractional "persons" for representation in the house of representatives is known as the _____ compromise.
Can the slope of the line represent density
_____ help one slide flow gracefully into the next during a slide show. A. Videos B. Transitions C. Variants D.Shapes
Sleepwalking is most likely to occur in _____.
Which of the following statements is true? 1 mL = 1 g 1 g = 1 oz 1 mL = 1 cm3 1 g = 1 cm
Without heat from the Sun, the water cycle would
In mexico and japan, jana noticed that it seemed easy to convince people to work together for the good of the group. how would you characterize this trait?
When talking about adding an ingredient to food in spanish, how do you say 'to taste.'?