
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

315 Views
In Python, a string is one of the data structures that is a sequence of characters enclosed within single quotes '' or double quotes "". It is immutable, i.e., once a string is created, it cannot be changed. When we want to check if both halves of the string have the same set of characters in Python, we can follow the steps below - First, based on the length of the string, we have to split the string into two halves. Next, convert each half into a set of characters using set() function. Finally, compare the two sets using ... Read More

984 Views
In this article, we will solve the problem of checking balanced parentheses. Let's understand the problem statement, The following are the conditions for balanced parentheses − Every opening parenthesis has a corresponding closing parentheses. Parentheses should be closed in the correct order. For example, "{[()]}" is a balanced parenthesis. condiser the same example with different arrangment "{([})]" which is unbalanced parantheses. Checking parentheses Using 'list' and 'for' loop list is one of the built-in data types in Python. A Python list is a sequence of comma-separated items, enclosed ... Read More

187 Views
In this article, we will learn about the fundamentals of software testing by the help of unittest module available in Python 3.x. Or earlier. It allows automation, sharing of the setup and exit code for tests, and independent tests for every framework.In unit test, we use a wide variety of object oriented concepts. We will be discussing some majorly used concepts here.Testcase − It is response specific base class in accordance with a given set of inputs. We use base class of unittest i.e. “TestCase” to implement this operation.Testsuite − It is used to club test cases together and execute ... Read More

482 Views
In this article, we will be learning about the twitter sentimental analysis. We will register for twitter oAuth API, install all the dependencies and finally write our sentimental analyzer script.An API(Application programming interface) is a gateway that allows you to access some servers(Twitter) internal functionality.The prerequisite is that we have a twitter account set up with verified phone number.After this, we visit the twitters website and tap on the create a new app icon. Now we fill all the credentials i.e. name and accept the developer agreement and finally click on create.Now our app is created , on the top ... Read More

3K+ Views
In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a list iterable as input, we need to display odd numbers in the given iterable.Here we will be discussing three different approaches to solve this problem.Approach 1 − Using enhanced for loopExamplelist1 = [11, 23, 45, 23, 64, 22, 11, 24] # iteration for num in list1: # check if num % 2 != 0: print(num, end = " ")Output11, 23, 45, 23, 11Approach 2 − Using lambda & filter functionsExample Live Demolist1 = [11, 23, 45, 23, ... Read More

520 Views
In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven the starting and ending range of an interval. We need to print all the numbers in the interval given.A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.There are two for loops, first for loop is for getting the numbers in the interval and second loop for the checking whether the number is prime or not.Now let’s see the implementation.Example Live Demostart = 10 end = 29 for val in range(start, end + ... Read More

761 Views
In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a list iterable, we need to print all the negative numbers in the list.Here we will be discussing three approaches for the given problem statement.Approach 1 − Using enhanced for loopExamplelist1 = [-11, 23, -45, 23, -64, -22, -11, 24] # iteration for num in list1: # check if num < 0: print(num, end = " ")Output-11 -45 -64 -22 -11Approach 2 − Using filter & lambda functionExample Live Demolist1 = [-11, 23, -45, 23, -64, -22, -11, ... Read More
13K+ Views
Python Programming Language is one of the most efficient and user-friendly programming language and have endless uses and applications. Lists declared in Python are analogous to dynamically sized arrays in other programming languages (vector in C++ and ArrayList in Java). A list is simply a collection of items enclosed by [] and separated by commas. In this tutorial, we will learn about the solution and approach to find out all even numbers in a given list using Python. List is one of the most fundamental data structures in python. They are widely used and they store similar contiguous data. A ... Read More
6K+ Views
In Python Programming Language, Length is the concept of calculating the entire range of the string that begins from the first character of the string till the last character of the string. Printing and calculating even length in a string is a basic exercise in the programing language. In this tutorial, we will learn about the solution and approach to find out all words in a string having even length. A number is considered odd if it divides by 2 evenly, i.e. leaving no remainder. This property should hold for the length of the words we need. So the ... Read More

952 Views
In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a range, we need to print all the odd numbers in the given range.The brute-force approach is discussed below −Here we apply a range-based for loop which provides all the integers available in the input interval.After this, a check condition for odd numbers is applied to filter all the even numbers.This approach takes O(n) + constant time of comparison.Now let’s see the implementation below −Examplestart, end = 10, 29 # iteration for num in range(start, end + 1): # check ... Read More