<jupyter_start><jupyter_text>Q 1: write a Program to display the Fibonacci sequence up to n-th term where n is provided by the user<jupyter_code>n = int(input("Enter the range: "))
list_fab = []
def fibonacci(n):
    if n==1 or n ==2:
        list_fab.append(n)
    else:
        x= list_fab[-1] + list_fab[-2]
        list_fab.append(x)
    print("Fabonacci append step: "+str(i),list_fab)
for i in range(1,n):
    fibonacci(i)
print("Final list :",list_fab)
#test
list_appa = [1, 4, 9, 16, 25, 36, 49]
list_appa.append(4)
list_appa[-1] + list_appa[-2]<jupyter_output><empty_output><jupyter_text>Q2: Write a Python Program To Display Powers of 2 Using Anonymous Function  ( Lambda function). Take number of terms from user<jupyter_code>range_num = list(int(input("Enter no: " + str(i+1) +str(" "))) for i in range (7))

power_two = list(map(lambda x: x ** 2 , range_num))

power_two<jupyter_output>Enter no: 1 1
Enter no: 2 2
Enter no: 3 3
Enter no: 4 4
Enter no: 5 5
Enter no: 6 6
Enter no: 7 7<jupyter_text>Q3: Write a Python Program to find numbers divisible by thirteen from a list using anonymous function<jupyter_code>range_num_thirt = list(int(input("Enter no: " + str(i+1) +str(" "))) for i in range (7))


div_thirteen = list(filter(lambda x: (x%13==0) , range_num_thirt))


print(div_thirteen)<jupyter_output>Enter no: 1 13
Enter no: 2 26
Enter no: 3 39
Enter no: 4 52
Enter no: 5 65
Enter no: 6 2
Enter no: 7 5
[13, 26, 39, 52, 65]<jupyter_text>Q4: Write a Python program to display the Fibonacci sequence up to n-th term by using recursive functions<jupyter_code>range_num_fab = int(input("Enter the range :"))


def fabbo(n):
    if n==1 or n==0:
        return n
    else:
        return fabbo(n-1)+fabbo(n-2)
    
for i in range(range_num_fab):
    print(fabbo(i))<jupyter_output>Enter the range :6
0
1
1
2
3
5<jupyter_text>Q5: Write a Python program to find the sum of natural numbers up to n using recursive function<jupyter_code>sum_natural = int(input("Enter the range :"))

start=1
sux=0
def natural(n):
    sux=0
    for i in range (n+1):
        sux= sux+i
        
    return(sux)
natural(sum_natural)
sum_natural = int(input("Enter the range :"))

def rec_nat(n):
    if n ==1 or n==0:
        return n
    else:
        return rec_nat(n-1)+n

    
for i in range(1,sum_natural+1):
    summ= rec_nat(i)
    
print(summ)<jupyter_output>Enter the range :10
55<jupyter_text>Q6: Write a Python program to convert decimal number into binary number using recursive function<jupyter_code>decx = int(input("Enter decimal number: "))

def deci_bin(deci):

    if (deci == 0):
        return 0
    else:
        return (deci % 2 + 10*deci_bin(int(deci//2)))
                            
deci_bin(decx)<jupyter_output>Enter decimal number: 432
{'fraction_non_alphanumeric': 0.11969532100108814, 'fraction_numerical': 0.03989844033369604, 'mean_word_length': 3.746987951807229, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '654010', 'license': 'Apache-2.0', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1031, 'n_words': 327, 'path': 'Lab5_sol.ipynb', 'repo_name': 'Deovart/CDAC_Python', 'size': '2757'}