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 old can a dog be until it die's?
Clinical trials for drugs include
What happens to the particles of a substance when thermal energy is added to the substance?
A recipe for whole grain rolls calls for 3/4 cup of rye flour. The recipe makes 6 rolls. How many cups of rye four are needed to make 32 rolls
An ice cube has a capacity of 0.25ml what is the volume of the ice cube
A car travels 90 meters north in 15 seconds. Then turns around and travels at 40 meters south in 5.0 seconds. what is the average velocity during this 20 second
A recipe includes 2 cups of flour and two thirds cup of milk. write the ratio of the amount of flour to the amount of milk as a fraction in simplest form.
A neutral metal comb is held near an object with a negative charge. What happens to the comb? A. The comb is charged by contact. B. The comb is charged by frict
What is the function of adp pi?
What is a cubic polynomial function in standard form with zeros -4, -5, and 4?