Python Recursion
A function can call other functions. It is even possible for the functions to call itself. These types of construct are termed as recursive functions. Recursion Concept: Image Source: LinkedIn …
A function can call other functions. It is even possible for the functions to call itself. These types of construct are termed as recursive functions. Recursion Concept: Image Source: LinkedIn …
Python Program To Solve Quadratic Equation In algebra, a quadratic equation is any equation that can be rearranged in standard form: where x represents an unknown, and a, b, and …
Python Program to Check Prime Number Using Counter And Function Example n= 10 i=2 counter = 0 if n > 0: def primeNumber(N): counter=0 for i in range(2,int(N/2)+1): if (N%i …
Python Program to Check Prime Number Using Flag Example n= 10 flag = False i=2 if n > 0: while i<n: if (n%i==0): flag=True i+=1 if flag: print(n,’ is not …
Python Program to Check Given Number is Odd Or Even Using Counter Example number = int(input('Enter the value: ')) counter = 0 if (number%2 == 0): counter = 1 if …
Python Program to Check Given Number is Odd Or Even Using Flag Example number = int(input(‘Enter the value: ‘)) flag = False if (number%2 == 0): flag = True if …
Python Program to Check Given Number is Odd Or Even Example number = int(input('Enter the value: ')) if (number%2 == 0): print('it is an even number.') else: print('it is an …
Python Program to Check Given Number is Positive, Negative or zero Example number = int(input(‘Enter the value: ‘)) if (number == 0): print(‘it is zero.’) else: if number > 0: …
Python Program to Check Given Number Is Armstrong Or Not Example def Armstrong(N): digits = len(str(N)) addition=0 temp=N while(N>0): D = int(N%10) addition = addition + (D**digits) N = int(N/10) …
Python Program to Find Sum of N Natural Numbers Using Recursion Example def Sum(N): if N==1: return(1) return (N+Sum(N-1)) n = int(input(‘Enter Input: ‘)) #n=5 addition = Sum(n) print(“Sum Of …