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

expand and simplify(3x+2)^2-(2x-1)^2
On the periodic table, each element has a unique name and formula? True or false?
A sentence with the words drawbacks and counterpoint?
List the pros and cons of a savings account.
What is the x-intercept of the line with the equation 1/3x + y = -15 ?
Roman has 2 red pencils in his backpack. If this is 25% of the total number of pencils, how many pencils are in his backpack?
a seamstress has a piece of cloth that is 3 yards long. she cuts it into shorter lengths of 16inches each. how many shorter pieces can she cut
America is referred to as a social experiment what do you think that phrase means
mr.white can travel for 6 hours while taking 3 breaks of 10 mins each once he had to travel for 36 hours how many minutes in breaks did he take
use the commutative property to find the unknown numberin the equation 35x70=mx35