Question: Define a function that takes one parameter, a list of numbers. The function returns True if the list is in ascending order, and false otherwise.
Define a function that takes one parameter, a list of numbers. The function returns True if the list is in ascending order, and false otherwise. You can use this for each number in the list (except the last) compare the number to the next one, and if the number is greater than the next one, return false. If the loop completes, return true. (Use indexing, check if a[i] > a[i 1]) Write a main program that reads numbers from the user until the user enters a blank line, storing the numbers in a list. Then pass the list to the function and tell the use if the list was in ascending order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
