如何用python求多个数的阶乘并生成散点图
import matplotlib.pyplot as plt
n = 5 #自定义最大阶乘值r = []for i in range(1, n+1):temp = 1for j in range(1, i + 1):temp = temp * jr.append(temp)fig = plt.figure()ax = fig.add_subplot(111)ax.scatter(list(range(1, n+1)), r)plt.show()