Python If-Else
The if-else statement is used in python for decision making. If Statements: Syntax if(condition): statement(s) If Examples: 01. Example x=2 if x>10: print(“Number is greater than 10.”) print(‘This will always …
The if-else statement is used in python for decision making. If Statements: Syntax if(condition): statement(s) If Examples: 01. Example x=2 if x>10: print(“Number is greater than 10.”) print(‘This will always …
Lambda function is a function without a name. Lambda function is also known as an anonymous function. They are defined using lambda keyword. Lambda functions are used extensively along with …
Python For Loops: Used to iterate over a sequence (list, tuple, string) or other iterable objects. Iterating over a sequence is called traversal. Table Of Contents 01. For …
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 …