Forum Discussion
baxatob
7 years agoCommunity Hero
Hi,
Using Python as a scripting language, you can make a simple check:
def is_sorted(arr): if arr == sorted(arr): return True else: return False
arr = ['d', 'c', 'a', 'e', 'b']
is_sorted(arr)
>> False
arr = ['a', 'b', 'c', 'd', 'e']
is_sorted(arr)
>> True
- sanj7 years agoSuper Contributor
Instead of checking to see if its sorted why dont you just sort it and you are done
A sorted function can be used to sort an array list
Related Content
- 3 years ago
- 2 years ago
- 4 years ago
- 6 years ago