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

What prompted the East German government to build the Berlin Wall?
what is this answer to this problem?
Sam is obese and as a result has diabetes and heart disease. these are caused by a type of malnutrition overtime. quizlit
In a class, every student knows French or German (or both). 15 students know French, and 17 students know German. What is the largest possible number of student
Lillian is applying for financial aid for college and she is completing her FAFSA form. Why is this application asking her for her financial information?
PLEASE HELP- Andy wrote the equation of a line that has a slope of and passes through the point (3, –2) in function notation. Step 1: y – (–2) = (x – 3) Step 2:
Why does Romeo begin speaking in poetry as soon as he meets Juliet?
Find the range of f(x) = –2x – 5 for the domain {–2, –1, 1, 2}. {1, 3, 5, 7} {–1, –3, 3, 5} {–1, –3, 7, 9} {–1, –3, –7, –9}
What are common ways enslaved Africans resisted onboard the slave ship
The word jump and stunt are examples of which sound device?