def keyword in Python | Keyword
In Python def keyword is used to create, (or define) a function. With function, you can break the program into smaller and modular chunks. def… Read More »def keyword in Python | Keyword
python
In Python def keyword is used to create, (or define) a function. With function, you can break the program into smaller and modular chunks. def… Read More »def keyword in Python | Keyword
Python lambda if-else function is used to choose a return value based on some condition. Syntax: if-else in lambda function is a little tricky Simple… Read More »lambda if-else Python | Function code
Use a while loop with if statement condition i % 2 == 0 then only print the first 10 even numbers in Python. Example print… Read More »Python program to print first 10 even numbers using while loop | Code
Use for loop or functools reduce() and numpy prod() or math prod() to find a product of a list in Python. There are more ways… Read More »Python product of list | Example code
Use the sum() function with a generator expression to get a sum list of lists in Python. Python sum list of lists example Simple example… Read More »Python sum list of lists | Example code
To get the Factorial of a number in Python using recursion, you have to use function, if statement and recursion login. factorial of n is… Read More »Factorial of a number in Python using recursion | Example code
You can use the math module factorial function to create your own Factorial program in Python using function. To create your own factorial function you… Read More »Factorial program in Python using function | Example code
Python min() function returns the lowest value in an iterable object or finds the smallest item between two or more parameters. Find the smallest item… Read More »Python min() function | Basic
Python max() function returns the item with the highest value in an iterable object or largest of two or more arguments. Find the largest item… Read More »Python max() function | Basic
You have to import NumPy Module and use * to multiply each element in list Python NumPy. Multiply each element in list Python NumPy Simple… Read More »Multiply each element in list Python NumPy | Example code