In Python, is the following the only way to get the number of elements?
arr.__len__()
If so, why the strange syntax?
you can use len(arr) as suggested in previous answers to get the length of the array. In case you want the dimensions of a 2D array you could use arr.shape returns height and width
len(arr)
arr.shape