Page 72 - PYTHON-12
P. 72
Program 9: Write a Program to enter the number and print the Floyd’s Triangle in
decreasing order.
Solution:
#Floyd's triangle
n=int(input("Enter the number :"))
for i in range(5,0,-1):
for j in range(5,i-1,-1):
print (j,end=' ')
print('\n')
Program 10: Write a Program to find factorial of entered number using user-defined module
fact().
Solution:
#Using function
import factfunc
x=int(input("Enter value for factorial : "))
ans=factfunc.fact(x)