import numpy as np
import math
nlevels = 3
Counting = 0
for p1 in range(nlevels):
for p2 in range(nlevels):
iconfig = np.zeros(nlevels)
iconfig[p1] += 1
iconfig[p2] += 1
print('%s' % str(iconfig))
Counting += 1
print ('Total number of microstates for this system is', Counting)