Found 33676 Articles for Programming

What is C++ programming language?

Paul Richard
Updated on 10-Feb-2020 10:58:50

5K+ Views

C++ is a programming language developed by Bjarne Stroustrup in 1979 at Bell Labs. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. It is a superset of C, and that virtually any legal C program is a legal C++ program. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.It is a language that is − Statically typed − A programming language is claimed to use static typing when type checking is performed during compile-time as opposed to run-time. Compiled − A compiled ... Read More

What does 'not in' operator do in Python?

Malhar Lathkar
Updated on 26-Feb-2020 10:40:31

348 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)

What does \\\'is\\\' operator do in Python?

Disha Verma
Updated on 21-Apr-2025 16:34:55

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

What is Python equivalent of the ! operator?

Gireesha Devara
Updated on 09-Sep-2023 09:48:50

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

What does these operators mean (** , ^ , %, //) ?

Disha Verma
Updated on 18-Apr-2025 14:10:06

552 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

What is the difference between = and == operators in Python?

Disha Verma
Updated on 18-Apr-2025 14:15:37

2K+ 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

What is different in OR and AND operators in Python?

Disha Verma
Updated on 18-Apr-2025 14:48:45

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

What is different in | and OR operators in Python?

Disha Verma
Updated on 21-Apr-2025 16:33:43

2K+ 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

What is different in & and AND operators in Python?

Disha Verma
Updated on 18-Apr-2025 15:05:04

543 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

What are boolean operators in Python?

Disha Verma
Updated on 18-Apr-2025 15:12:10

8K+ Views

The Boolean operators in Python return two values, either true or false. These operators are mostly used in conditional statements, loops, and logical expressions. Python has a built-in Boolean datatype that returns Boolean values based on comparisons or logical evaluations between operands. Boolean Operators in Python There are three main Boolean operators in Python: OR, AND, and NOT. These operators return Boolean values based on the operands. 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 ... Read More

Advertisements