Program def fc(num): bina=bin(num)[2:] complement='' for b in bina: if b=='1': complement+='0…
Read moreProgram arr=eval(input("enter list element")) a=arr[0] b=arr[1] for i in range(0,len(arr)): for j in range(i+1,len(arr)): if …
Read morel=["cat","dog","doll","rat"] prefix="do" output=[] for word in l: if prefix==word[0:len(prefix…
Read moreIf two prime difference is 2 then number is called twin prime number. So to check number is twin prime or not First check number is prime or not. Se…
Read moreProgram to repeat name without using for loop is possible using self recursive function calling condition is set inside the function .function is cal…
Read morePositive integer that is equal to sum of its positive divisor excluding the number itself. Program n=int(input("enter number")) sum=0 for…
Read moreNumber of n digits which are equal to sum of nth power of digit. Program for i in range(1,1000): num=i n=len(str(i)) sum1=0 i=str(i)…
Read moreDifference1 List: List is comma seperated value in square bracket and bracket is mandatory. L=[1,2,3] Tuple: Tuple is comma seperated value in paren…
Read moreQ1 What is Python? List some popular applications of Python in the world of technology. Python is a widely-used general-purpose, high-level …
Read moreProgram to find common between three sorted list in python. To find common between three sorted list using brute force is take O(n^3) time because br…
Read moreProgram of quicksort in python Quicksort is based on divide and conquer approach In which list is divided into two parts element less than pivot in…
Read moreProgram to find common three sorted list with complexity O(n) in python. def fc(a,b,c): n=len(a) h=len(b) k=len(c) x=0 y=0 z…
Read moreQ1.what is the output of code. r=[2,1,0,3] for i in r: r[s]=0 print(r) output first r[2]=0 so list [2,1,0,3] next r[1]=0 so list[2,0,…
Read moreQ1Program to find kth smallest element(using bubble sort) in the list. def smallkth(a,lb,ub,k): for i in range(lb,ub): for j in…
Read moreQ1Program to shuffle and print the list [3,6,7,8]. from random import shuffle li=[3,6,7,8] shuffle(li) print(li) Output >>> ====…
Read moreQ1Program which will find all such numbers which are divisible by 7 but are not a multiple of 5, and between 2000 and 2100. l=[] for i in r…
Read moreQ1.Program to check entered number is even then find square. def odd(n): if(n%2==0): print(n*n) else: …
Read moreQ1. Program of linear search using recursion. def linearsearch(l,size,item): if(size >> === RESTART: C:/Users/Dell/AppData/Local…
Read moreQ1.program to draw histrogram of population (x=[1,11,15,23,25,28,35,36,38,37,48,45,47,45,46,55,58,55,56,57,55])age count. import matplotlib…
Read moreQ1.Program to evaluate postfix expression. op=['+','-','*','/'] s=[] exp=[] exp=input("enter expressio…
Read moreCopyright (c) 2021 NS All Right Reseved
Social Plugin