Forum Discussion
baxatob
Community 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
sanj
8 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
- 4 years ago
- 7 years ago
- 4 years ago
- 2 years ago
Recent Discussions
- 10 hours ago