×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
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
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
Jayashree
has Published
93
Answers
What is @ operator in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 06-Mar-2018 05:51:14
@ symbol is used to define decorator in Python. Decorators provide a simple syntax for calling higher-order functions. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.we have two different kinds of decorators in Python:Function decoratorsClass ...
Read More
What is different in & and AND operators in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 06-Mar-2018 05:39:04
In Python, and is often called relational operator. Its two operands themselves are boolean expressions which may be true or false. Result of and operation will be true only if both operands are true.>>> a=11 >>> b=5 >>> a>10 and b>10 False >>> a=11 >>> b=15 >>> a>10 and b>10 ...
Read More
How to Transpose a matrix in Single line in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 06-Mar-2018 05:26:21
The NumPy package contains a very handy function transpose() to convert ndarray object into a transposed array>>> a = np.array([[1, 2], [3, 4]]) >>> a array([[1, 2], [3, 4]]) >>> a.transpose() array([[1, 3], [2, 4]])
How to Transpose a Matrix using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 06-Mar-2018 05:23:25
When rows and columns of a matrix are interchanged, the matrix is said to be transposed. In Python, a matrix is nothing but a list of lists of equal number of items. A matrix of 3 rows and 2 columns is following list objectX = [[12, 7], [4 ...
Read More
How to Convert Decimal to Binary Using Recursion in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 06-Mar-2018 05:14:19
Binary equivalent of a decimal number is obtained by printing in reverse order the remainder of successive division by 2. The recursive solution to this conversion is as follows:def tobin(x): strbin='' if x>1: tobin(x//2) print (x%2, end='') num=int(input('enter a ...
Read More
How to Multiply Two Matrices using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 05-Mar-2018 20:31:37
Multiplication of two matrices is possible only when number of columns in first matrix equals number of rows in second matrix.Multiplication can be done using nested loops. Following program has two matrices x and y each with 3 rows and 3 columns. The resultant z matrix will also have 3X3 ...
Read More
How to check whether a number is prime or not using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 05-Mar-2018 20:18:10
Principle used in following solution to this problem is to divide given number with all from 3 its square root, a number's square root is largest possible factor beyond which it is not necessary to check if it is divisible by any other number to decide that it is prime ...
Read More
What is difference in abs() and fabs() in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 05-Mar-2018 19:49:27
Both functions return the absolute value of a number by ignoring its sign. However, abs() is a built-in function and doesn't need any library / module to be loaded. The fabs() function on the other hand is defined in math module, hence the same must be imported before using.>>> abs(-45) ...
Read More
How do I find the largest integer less than x in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 05-Mar-2018 19:31:32
Python's floor() function returns nearest integer less than the given number.>>> import math >>> x=6.67 >>> math.floor(x) 6 >>> x=1.13 >>> math.floor(x) 1 >>> x=-5.78 >>> math.floor(x) -6Note that -6 is less than -5.78
Read More
How to find the smallest number greater than x in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 05-Mar-2018 19:27:59
The built-in function ceil() returns smallest number that is greater than the given number>>> x=6.67 >>> import math >>> math.ceil(x) 7 >>> x=1.13 >>> math.ceil(x) 2 >>> x=5.78 >>> math.ceil(x) 6 >>> x=-5.78 >>> math.ceil(x) -5Note that -5 is greater than -5.78
Read More
Previous
1
2
3
4
5
6
7
...
10
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout