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

3. How do you think your dietary practices affect your physical, social, and mental health? Do any of your dietary practices put your health at risk? (4 points)
How do states get electors?
HELP ASAP PLEASE !!
The amount of water a body requires for survival is dependent upon the climate and the individual’s level of physical activity. Please select the best answer
The volume of a prism is the base (B) times the length of its height (H). Which of the following is the formula for the volume of a prism? A.) V=bw B.) V=1/2 B
How was the country of Turkey created?
Rewrite the expression 7x^2+14x-56 as three factors where one of the factors is an integer value. Choose three factors and write an equivalent expression. A.) 6
Most present-day Israelis originally came from _____.
Please help ASAP with math question?
What is the x-intercept of the graph of the function f(x) = x^2 − 16x + 64? (−8, 0) (0, 8) (8, 0) (0, −8)