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

You roll a number cube once and flip a coin. Find the probability of a compound event. Rolling a factor of 12 and flipping tails.
2.Why is a sound wave considered to be a mechanical wave?
Tuliskan persamaan yang menyatakan hubungan antara kecepatan panjang dan frekuensi gelombang
If f = 350i - 250j - 450k6 n and cable ab is 9 m long, determine the x, y, z coordinates of point a
Lizabeth earns $13.50 an hour plus time and half for weekend work. Last week, she worked her regular 40 hours plus 7 hours on saturday. What is her total pay fo
What is the average of 66, 62, and 82
Three less than 5 times a number is less than or equal to 17.
The five factor model was based on a combination of _____ and _____ approaches to studying personality taxonomies.
The division of Earth’s history into smaller units makes up the ____. a. eras c. periods b. geologic time scale d. sequence of events Please select the best
What six steps occur in a criminal case between arrest of a suspect and sentencing?