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

Is little available food a characteristic of Athens, Sparta, or both?
In Central Africa, the (blank) climate allows thick forests to grow. Please help
Select all choices that apply. Which were physical characteristics of Mesopotamia? Choose all answers that are correct. A. Mesopotamia was between the Tigris an
how much thermal energy is needed to produce 1 cubic meter of steam
The ability to recognize reality and to cope with the demands of daily life is _____ health.
Which word is the preposition and which word is the object of the preposition in this sentence? Our car bounced and rattled loudly over the old bridge. A. prepo
The Eighteenth Amendment, "Prohibition," was reversed by the _______ Amendment. A. Twenty-second B. Twenty-first C. Twentieth D. Nineteenth
what force keeps an object moving in a circle
Describe how the characteristics of ocean water near an iceberg change from summer to winter. A. higher salinity and lower density B. lower salinity and higher
Which group received cash payments based on the sale of antitank arms in Iran? Sandinistas Mujahedeen Grenadians Contras