In [1]:
def fact(n):
if n == 1:
return n
else:
return n*fact(n-1)
n= 8 #int(input("Enter the number : "))
for i in range(1,n+1):
x=list(map(str,list(range(1,i+1))))
print(i,"! = "," x ".join(x)," = ",fact(i),sep="")
In [2]:
def fact(n):
if n == 1:
return n
else:
return n*fact(n-1)
n= int(input("Enter the number : "))
for i in range(1,n+1):
x=list(map(str,list(range(1,i+1))))
print(i,"! = "," x ".join(x)," = ",fact(i),sep="")
In [ ]:
import matplotlib.pyplot as plt
import numpy as np
a = arange(0,1,0.01)
y = np.cos(2*np.pi*a)
plt.plot()