flat a nested list in python | flat implementation in python
Some time we have a nested list which we want to make in one dimensional array or you can say we want to flat it. def flat(arr): #base condition if…
Some time we have a nested list which we want to make in one dimensional array or you can say we want to flat it. def flat(arr): #base condition if…
We can generated all possible combination of alphabets or number using python with only few lines of code. We can use these combination to give unique identity to any one.…
The ternary operator is very useful for a single condition. But support ternary operator different way, not like other programming languages (?:). Syntax: A if C else B This first…
Here are my python interview/job preparation questions and answers. Which can help to to clear the interview or also help to take interview of any candidates. What is list ?…
Stack implementation: class Stack: def pop(self): return self.items.pop() def __init__(self): self.items = [] def push(self, item): return self.items.append(item) def size(self): return len(self.items) def peek(self): return self.items[len(self.items)-1] def isEmpty(self): return len(self.items)…
In the previous blog, we have learned about python variable now we will learn the use of the operator on those variables. Whenever we write a logical statement we need…
In any programming language, data types play important role, since the whole language base on data structure and how we store data and retrieve back. In this post we will learn basic data type of python.
In the previous blog post, we saw how to install the python. Now, we will see how to run a simple "Hello World" program in python. This will help you…