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)
   67   68   69   70   71   72   73   74   75   76   77