Sunday, 23 January 2022

Write a python script to generate Fibonacci terms using the generator function.

Slip 5 Q 2

CODE :



def generator(r):
    a=0;b=1
    for i in range (1,r):
        print(b)
        a,b=b,a+b
       
n=int(input('Enter a number :'))
if n==0:
    print('0')
else:
    print(0)
    generator(n)


OUTPUT :



No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...