Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
26 views
Kernel: Python 2 (SageMath)
import numpy as np import matplotlib.pyplot as plt listl = [] x = 0 while (x <= 100): value = 9.25**x s = str(value) v = int(s[0]) listl.append(v) x = x+1 print listl q = np.array(listl) plt.hist(q,bins=9) plt.show()
[1, 9, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4]
<matplotlib.figure.Figure at 0x7f3539b9af90>