Python Program To Find Factors Of A Number Using While Loop
Python Program To Find Factors Of A Number Using While Loop Example def factors(x): print("Factors Of {}:".format(x)) i = 1 while(i < (x+1)): d=x%i if d==0: print(i) i+=1 n=18 # …
Python Program To Find Factors Of A Number Using While Loop Example def factors(x): print("Factors Of {}:".format(x)) i = 1 while(i < (x+1)): d=x%i if d==0: print(i) i+=1 n=18 # …
Python Program To Find Factors Of A Number Using Recursion Example def factors(x,i): if(x >= i): if ((x%i)==0): print(i) factors(x,i+1) n=18 # n = int(input(“Enter Integer Value: “)) factors(n,1) Output: …
Python Program To Find Factors Of A Number Using For Loop Example def factors(x): print("Factors Of {}:".format(x)) for i in range(1,x+1): d=x%i if d==0: print(i) n=18 # n = int(input("Enter …
Python Program To Find Factorial Using While Loop Example N = int(input("Enter a number: ")) factorial = 1 counter = 1 while counter <= N: factorial = factorial * counter …
Python Program To Convert Decimal Into Binary Using List Example n=10 array=[] def decimalToBinary(N): string = "" while(N>0): a=int(N%2) array.append(a) N = N//2 for i in range(0,len(array)): string += str(array[i]) …
Python Program To Find Area Of A Right Angled Triangle The above image is showing the “Pythagoras theorem” where the sum of the “BASE” square and the “PERPENDICULAR” square is …
Python Program To Convert Decimal Into Binary Using String Example n=10 def decmialToBinary(N): string = "" while(N>0): a=int(N%2) string += str(a) N = N//2 print(string[::-1]) decmialToBinary(n) Output: 1010
Python Program To Check Three Input Values Representing Right Angled Triangle Or Not The above image is showing the “Pythagoras theorem” where the sum of the “BASE” square and the …
Python Program To Print All ASCII Values Example def printASCIIValues(): for i in range(32,127): print('The Decimal Value ',i,' Has ASCII Value ',chr(i)) printASCIIValues() Output: The Decimal Value 32 Has …
Python Program To Find First Time Of Occurrences Index Of An Element In List Example def firstTimeOccuringIndex(dataArray,N): count = 0 for i in range(0,len(dataArray)): if(dataArray[i] == N): print("{} is First …