×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Pavitra
has Published
241
Answers
Multi-Line printing in Python
Python
Server Side Programming
Programming
Pavitra
Published on 30-Dec-2019 14:53:46
We have usually seen the print command in python printing one line of output. But if we have multiple lines to print, then in this approach multiple print commands need to be written. This can be avoided by using another technique involving the three single quotes as seen below.Example Live Demoprint(''' ...
Read More
Counters in Python?
Python
Server Side Programming
Programming
Pavitra
Published on 30-Dec-2019 14:49:58
Python Counter class belongs to Collections module. It is also a subclass of Dictionary and keeps track of elements in the dictionary and their count. #Counter is an unordered collection where elements are stored as Dict keys and their count as dict value. Counter components count can be positive, zero ...
Read More
Contingency Table in Python
Python
Server Side Programming
Programming
Pavitra
Published on 30-Dec-2019 14:48:34
A contingency table is a table showing the distribution of one variable in rows and another variable in columns. It is used to study the correlation between the two variables. It is a multiway table which describes a dataset in which each observation belongs to one category for each of ...
Read More
Adding two Python lists elements
Python
Server Side Programming
Programming
Pavitra
Published on 30-Dec-2019 14:44:57
Lists can be added in python resulting in creation of a new list containing elements from both the lists. There are various approaches to add two lists and they are described below. But in all these cases the lists must be of same length.Using Append()Using append() we can add the ...
Read More
Python-program-to-convert-pos-to-sop
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 10:23:13
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given pos form we need to convert it into its equivalent sop formThe conversion can be done by first counting the number of alphabets in the pos form and then calculating all ...
Read More
Python program to print all Prime numbers in an Interval
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 10:14:53
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given an interval we need to compute all the prime numbers in a given rangeHere we will be discussing a brute-force approach to get the solution i.e. the basic definition of a ...
Read More
Python program to multiply two matrices
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 10:07:06
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given two matrices, we need to multiply them and print the result.For two matrices to be multiplied columns of the first matrix must be identical to that of the rows of the ...
Read More
Python program to interchange first and last elements in a list
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 10:01:58
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given a list, we need to swap the last element with the first element.There are 4 approaches to solve the problem as discussed below−Approach 1 − The brute-force approachExample Live Demodef swapLast(List): ...
Read More
Python program to insert an element into sorted list
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 09:59:19
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given a list, we need to insert an element in a list without changing sorted orderThere are two approaches as discussed below−Approach 1: The brute-force methodExample Live Demodef insert(list_, n): # search ...
Read More
Python program to get all subsets of a given size of a set
Python
Server Side Programming
Programming
Pavitra
Published on 24-Dec-2019 09:52:57
In this article, we will learn about the solution to the problem statement given below.Problem statement − We are given a set, we need to list all the subsets of size nWe have three approaches to solve the problem −Using itertools.combinations() methodExample Live Demo# itertools module import itertools def findsubsets(s, n): ...
Read More
1
2
3
4
5
6
7
...
25
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout