
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 10411 Articles for Python

36K+ Views
To convert an integer to a character in Python, we can use the chr() method. The chr() is a Python built−in method that returns a character from an integer. The method takes an integer value and returns a unicode character corresponding to that integer. Syntax char(number) Parameter The method takes a single integer between the range of 0 to 1, 114, 111. Return Value A unicode character of the corresponding integer argument. And it will raies a ValueError if we pass an out of range value (i, e. range(0x110000)). Also it will raise TypeError − for a non−integer argument. ... Read More

533 Views
The #define creates a macro, which is the association of an identifier or parameterized identifier with a token string. After the macro is defined, the compiler can substitute the token string for each occurrence of the identifier in the source file.#define identifier token-stringThis is how the preprocessor is used. The #define directive causes the compiler to substitute token-string for each occurrence of identifier in the source file. The identifier is replaced only when it forms a token. That is, identifier is not replaced if it appears in a comment, in a string, or as part of a longer identifier.example#include #define ... Read More

325 Views
In Python, in and not in operators are called membership operators. Their purpose is to check if an object is a member of a certain sequence object like string, list, or tuple. The not in operator returns false if object is present in sequence, true if not found>>> 'p' not in 'Tutorialspoint' False >>> 'c' not in 'Tutorialspoint' True >>> 10 not in range(0,5)

3K+ Views
The "is" operator in Python is an identity operator. This operator checks whether two variables refer to the same object in memory. It returns boolean values as a result. Each object in the computer's memory is assigned a unique identification number (id) by the Python interpreter. Identity operators check if the id() of two objects is the same. The 'is' operator returns false if id() values are different and true if they are the same. Syntax of Python (is) Operator The "is" operator follows the following syntax in Python: variable1 is variable2 The "is" operator ... Read More

3K+ Views
In some languages like C / C++ the "!" symbol is used as a logical NOT operator. !x it returns true if x is false else returns false. The equivalent of this "!" operator in python is logical NOT, It also returns true if the operand is false and vice versa. Example In the Following example the variable operand_X holds a boolean value True, after applying the not operator it returns False. operand_X = True print("Input: ", operand_X) result = not(operand_X) print('Result: ', result) Output Input: True Result: False Example For False value the ... Read More

365 Views
In Python, there are various types of operators used to perform specific functions, such as (**), (^), (%), and (//). The (**) operator represents exponentiation, (^) represents bitwise XOR, (%) represents the modulus operation, and (//) represents floor division. In this article, we will understand the workings of these operators. Exponentiation Operator (**) The exponentiation operator (**) is used to raise a number to a power. This operator works the same as the Python pow() method. In exponentiation, you need two numbers: the first is the base (the number you want to raise), and the second is ... Read More

1K+ Views
The symbols "=" and "==" look similar but have different meanings and usability in Python. The "=" symbol is the assignment operator, and the "==" symbol represents a comparison operator. In this article, we will understand the difference between these two and how to use them. The "=" Operator The "=" operator in Python is the assignment operator. It is used to assign a value to a variable. You put the variable on the left side and the value or expression on the right side. The value on the right is stored in the variable on the ... Read More

6K+ Views
The OR and AND operators are the most commonly used logical operators. The logical operators are used to perform decision-making operations. These combine multiple conditions and make a decision based on them. In this article, we will understand what OR and AND operators are in Python and how they differ, along with examples for better understanding. AND Operator in Python The logical AND operator in Python needs two operands. It returns true if both operands are true, and it returns false if either of the operands is false. This operator is mostly used in situations where you ... Read More

1K+ Views
The OR and (|) are logical operators in Python. The difference between these two is that OR is a Logical OR operator, and | is a Bitwise OR Operator. Both operators are used to perform different operations. In this article, we will explore the behavior of these operators and their differences. OR Operator in Python The OR operator in Python returns true if one of the operands is true and false if both operands are false. This operator needs two values or operands to perform the operation and return the result. OR Operator Example The following ... Read More

475 Views
The AND and & are logical operators in Python that are used to perform different operations. The AND is a logical AND operator, and the ampersand (&) is a bitwise operator. In this article, we will explore the behavior of these operators and their differences. AND Operator in Python The logical AND operator in Python needs two operands. This operator returns true if both operands are true and false if either operand is false. This operator is mostly used in situations where you want to make sure that two things are true at the same time. Example of the AND ... Read More