import numpy numbers = [50,66,77,88,99,100] x = numpy.var(numbers) print(x)
Here is what the above code is Doing:
1. We’ve imported the numpy library.
2. We’ve created a list of numbers.
3. We’ve assigned the value of the variance of the list of numbers to the x variable.
4. We’ve printed the value of the x variable.