what 1:[] mean in python code example

Example 1: what does [::-1] mean in python

list[<start>:<stop>:<step>]
So, when you do MyList[::-1], its starts from the end towards the begining taking each element by a step of 1 (hence -1). So, its reversing the list. Applicable to tuples as well

Example 2: python mean

# Probably the most convenient set of statistics functions are found
# in the Numpy package

# Basic syntax:
import numpy as np
np.mean(your_list) # Calculate mean
np.median()	# Calculate median
np.std()	# Calculate standard deviation
np.var()	# Calculate variance