import array
# Declare a list type object
list_object = [3, 4, 1, 5, 2]
# Declare an integer array object
array_object = array.array('i', [3, 4, 1, 5, 2])
print('Sorted list ->', sorted(list_object))
print('Sorted array ->', sorted(array_object))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter