Nov-29-2018, 12:11 PM
Siylo Wrote:How can I compare value[2] to value[1]?You need to manage a previous value, you can initialize it to list[0], for example
previous_value = list[0] for value in list: ...
defining a function to see if a list is sorted
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
A function that checks if the list is sorted | pooyan89 | 16 | 18,051 |
Apr-22-2024, 09:14 AM Last Post: DeaD_EyE |
|
How to Sorted and display the Subclasses of BaseException | Fernando_7obink | 9 | 4,063 |
Feb-10-2021, 12:04 PM Last Post: buran |
|
Defining x and y axes in Spectrogram Function | amy5678 | 3 | 2,445 |
Nov-29-2020, 01:42 PM Last Post: jefsummers |
|
Functions returns content of dictionary as sorted list | kyletremblay15 | 1 | 2,179 |
Nov-21-2019, 10:06 PM Last Post: ichabod801 |
|
python 3.4.3 Question a defining function | student8 | 1 | 4,440 |
Oct-02-2017, 07:59 PM Last Post: nilamo |
|
sorted list not displaying | Crackity | 6 | 5,353 |
Jul-18-2017, 12:50 PM Last Post: sparkz_alot |