It's said that China on day 1.7.2019 had 1 420 062 022 citizens. Number of citizens in China is increasing every year by 0,35%. Under the assumption that yearly growth of number of citizens won't change, show a graph with expected number of citizens in China in next 10 years.
我被困在这个问题上了。我知道如何表示一年的增长,但不知道如何用10表示增长,我是否应该重复10次,如下所示:
china1=1420062022
growthchina=china1*0.35/100
china2=china1+growthchina
growthchina2=china2*0.35%/100
china3=china2+growthchina
。。。等等
这就是我目前的处境:
import matplotlib.pyplot as plt
years=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
people_number=1420062022
plt.plot(years, people_number)
plt.title("Number of people in China")
plt.ylabel("(billions)")
plt.show()
plt.close()
Demo
这样计算:
相关问题 更多 >
编程相关推荐