Complete Guide to Python Operators: Types & Examples

Master Python operators with this comprehensive guide covering arithmetic, assignment, comparison, logical, and more with practical examples.

Understanding Python Operators

Python operators are special symbols or keywords that perform operations on operands (variables and values). They are fundamental building blocks that allow you to manipulate data, perform calculations, make comparisons, and control program flow. This comprehensive guide covers all types of operators in Python with detailed explanations, examples, and practical applications.

Table of Contents

1. [Arithmetic Operators](#arithmetic-operators) 2. [Assignment Operators](#assignment-operators) 3. [Comparison Operators](#comparison-operators) 4. [Logical Operators](#logical-operators) 5. [Identity Operators](#identity-operators) 6. [Membership Operators](#membership-operators) 7. [Bitwise Operators](#bitwise-operators) 8. [Operator Precedence](#operator-precedence) 9. [Special Operators](#special-operators) 10. [Practical Examples](#practical-examples)

Arithmetic Operators

Arithmetic operators are used to perform mathematical operations on numeric values. They work with integers, floating-point numbers, and complex numbers.

Basic Arithmetic Operators Table

| Operator | Name | Description | Example | Result | |----------|------|-------------|---------|--------| | + | Addition | Adds two operands | 5 + 3 | 8 | | - | Subtraction | Subtracts right operand from left | 5 - 3 | 2 | | | Multiplication | Multiplies two operands | 5 3 | 15 | | / | Division | Divides left operand by right | 10 / 3 | 3.333... | | // | Floor Division | Returns floor of division | 10 // 3 | 3 | | % | Modulus | Returns remainder of division | 10 % 3 | 1 | | | Exponentiation | Raises left operand to power of right | 2 3 | 8 |

Detailed Examples and Notes

`python

Basic arithmetic operations

a = 15 b = 4

Addition

result_add = a + b print(f"Addition: {a} + {b} = {result_add}") # Output: 19

Subtraction

result_sub = a - b print(f"Subtraction: {a} - {b} = {result_sub}") # Output: 11

Multiplication

result_mul = a * b print(f"Multiplication: {a} * {b} = {result_mul}") # Output: 60

Division (returns float)

result_div = a / b print(f"Division: {a} / {b} = {result_div}") # Output: 3.75

Floor division (returns integer part)

result_floor = a // b print(f"Floor Division: {a} // {b} = {result_floor}") # Output: 3

Modulus (remainder)

result_mod = a % b print(f"Modulus: {a} % {b} = {result_mod}") # Output: 3

Exponentiation

result_exp = a b print(f"Exponentiation: {a} {b} = {result_exp}") # Output: 50625 `

Important Notes on Arithmetic Operators

- Division Behavior: The / operator always returns a float, even when dividing two integers that divide evenly - Floor Division: The // operator performs floor division, which rounds down to the nearest integer - Modulus Applications: Commonly used to check if a number is even/odd or to cycle through values - Negative Numbers: Floor division with negative numbers rounds toward negative infinity

`python

Special cases with negative numbers

print(f"-10 // 3 = {-10 // 3}") # Output: -4 (not -3) print(f"-10 % 3 = {-10 % 3}") # Output: 2 print(f"10 // -3 = {10 // -3}") # Output: -4 `

Assignment Operators

Assignment operators are used to assign values to variables. They can also perform operations while assigning values, making code more concise.

Assignment Operators Table

| Operator | Name | Equivalent | Example | Description | |----------|------|------------|---------|-------------| | = | Simple Assignment | x = 5 | x = 5 | Assigns value to variable | | += | Addition Assignment | x = x + 5 | x += 5 | Adds and assigns | | -= | Subtraction Assignment | x = x - 5 | x -= 5 | Subtracts and assigns | | = | Multiplication Assignment | x = x 5 | x *= 5 | Multiplies and assigns | | /= | Division Assignment | x = x / 5 | x /= 5 | Divides and assigns | | //= | Floor Division Assignment | x = x // 5 | x //= 5 | Floor divides and assigns | | %= | Modulus Assignment | x = x % 5 | x %= 5 | Modulus and assigns | | = | Exponentiation Assignment | x = x 5 | x = 5 | Exponentiates and assigns |

Practical Examples

`python

Starting with a base value

x = 10 print(f"Initial value: x = {x}")

Addition assignment

x += 5 # Equivalent to x = x + 5 print(f"After x += 5: x = {x}") # Output: 15

Multiplication assignment

x = 2 # Equivalent to x = x 2 print(f"After x *= 2: x = {x}") # Output: 30

Division assignment

x /= 3 # Equivalent to x = x / 3 print(f"After x /= 3: x = {x}") # Output: 10.0

Floor division assignment

x //= 2 # Equivalent to x = x // 2 print(f"After x //= 2: x = {x}") # Output: 5.0

Modulus assignment

x %= 3 # Equivalent to x = x % 3 print(f"After x %= 3: x = {x}") # Output: 2.0

Exponentiation assignment

x = 4 # Equivalent to x = x 4 print(f"After x = 4: x = {x}") # Output: 16.0 `

Assignment with Different Data Types

`python

String concatenation with assignment

text = "Hello" text += " World" print(text) # Output: "Hello World"

List extension with assignment

numbers = [1, 2, 3] numbers += [4, 5] print(numbers) # Output: [1, 2, 3, 4, 5]

Multiplication with strings

greeting = "Hi! " greeting *= 3 print(greeting) # Output: "Hi! Hi! Hi! " `

Comparison Operators

Comparison operators are used to compare two values and return a Boolean result (True or False). They are essential for conditional statements and loops.

Comparison Operators Table

| Operator | Name | Description | Example | Result | |----------|------|-------------|---------|--------| | == | Equal to | Checks if values are equal | 5 == 5 | True | | != | Not equal to | Checks if values are not equal | 5 != 3 | True | | > | Greater than | Checks if left > right | 5 > 3 | True | | < | Less than | Checks if left < right | 5 < 3 | False | | >= | Greater than or equal | Checks if left >= right | 5 >= 5 | True | | <= | Less than or equal | Checks if left <= right | 3 <= 5 | True |

Detailed Examples

`python

Numeric comparisons

a = 10 b = 20 c = 10

print(f"a == c: {a == c}") # True print(f"a != b: {a != b}") # True print(f"a > b: {a > b}") # False print(f"a < b: {a < b}") # True print(f"a >= c: {a >= c}") # True print(f"a <= b: {a <= b}") # True

String comparisons (lexicographic order)

str1 = "apple" str2 = "banana" str3 = "apple"

print(f"str1 == str3: {str1 == str3}") # True print(f"str1 < str2: {str1 < str2}") # True (alphabetical order) print(f"str2 > str1: {str2 > str1}") # True

List comparisons (element-wise)

list1 = [1, 2, 3] list2 = [1, 2, 4] list3 = [1, 2, 3]

print(f"list1 == list3: {list1 == list3}") # True print(f"list1 < list2: {list1 < list2}") # True `

Important Notes on Comparisons

- Type Considerations: Comparing different types may raise TypeError in Python 3 - Floating Point Precision: Be careful when comparing floating-point numbers due to precision issues - String Comparison: Based on ASCII/Unicode values, case-sensitive

`python

Floating point comparison issues

x = 0.1 + 0.2 y = 0.3 print(f"x == y: {x == y}") # False due to floating point precision

Better approach for floating point comparison

import math print(f"math.isclose(x, y): {math.isclose(x, y)}") # True

Case sensitivity in strings

print(f"'Apple' == 'apple': {'Apple' == 'apple'}") # False print(f"'Apple'.lower() == 'apple': {'Apple'.lower() == 'apple'}") # True `

Logical Operators

Logical operators are used to combine conditional statements and work with Boolean values. They are crucial for creating complex conditions in control structures.

Logical Operators Table

| Operator | Description | Example | Result | |----------|-------------|---------|--------| | and | Returns True if both operands are True | True and False | False | | or | Returns True if at least one operand is True | True or False | True | | not | Returns True if operand is False (negation) | not True | False |

Truth Tables

#### AND Operator Truth Table | A | B | A and B | |---|---|---------| | True | True | True | | True | False | False | | False | True | False | | False | False | False |

#### OR Operator Truth Table | A | B | A or B | |---|---|--------| | True | True | True | | True | False | True | | False | True | True | | False | False | False |

#### NOT Operator Truth Table | A | not A | |---|-------| | True | False | | False | True |

Practical Examples

`python

Basic logical operations

a = True b = False

print(f"a and b: {a and b}") # False print(f"a or b: {a or b}") # True print(f"not a: {not a}") # False print(f"not b: {not b}") # True

Combining with comparisons

x = 10 y = 20 z = 15

Complex conditions

condition1 = x < y and y > z print(f"x < y and y > z: {condition1}") # True

condition2 = x > y or z < y print(f"x > y or z < y: {condition2}") # True

condition3 = not (x == y) print(f"not (x == y): {condition3}") # True

Short-circuit evaluation

def test_function(): print("Function called!") return True

In 'and', if first is False, second is not evaluated

result1 = False and test_function() # Function is not called print(f"Result1: {result1}")

In 'or', if first is True, second is not evaluated

result2 = True or test_function() # Function is not called print(f"Result2: {result2}") `

Short-Circuit Evaluation

Python uses short-circuit evaluation for logical operators: - AND: If the first operand is False, the second operand is not evaluated - OR: If the first operand is True, the second operand is not evaluated

`python

Practical use of short-circuit evaluation

def safe_divide(a, b): # Check if b is not zero before dividing return b != 0 and a / b

print(safe_divide(10, 2)) # 5.0 print(safe_divide(10, 0)) # False (avoids division by zero error) `

Identity Operators

Identity operators are used to compare the memory locations of two objects, not their values. They check if two variables refer to the same object in memory.

Identity Operators Table

| Operator | Description | Example | Usage | |----------|-------------|---------|--------| | is | Returns True if both variables are the same object | x is y | Object identity check | | is not | Returns True if variables are not the same object | x is not y | Negated identity check |

Examples and Important Distinctions

`python

Difference between 'is' and '=='

a = [1, 2, 3] b = [1, 2, 3] c = a

Value comparison vs identity comparison

print(f"a == b: {a == b}") # True (same values) print(f"a is b: {a is b}") # False (different objects) print(f"a is c: {a is c}") # True (same object)

String interning example

str1 = "hello" str2 = "hello" str3 = "hel" + "lo"

print(f"str1 == str2: {str1 == str2}") # True print(f"str1 is str2: {str1 is str2}") # True (string interning) print(f"str1 is str3: {str1 is str3}") # May vary (implementation dependent)

Integer caching (-5 to 256)

x = 100 y = 100 print(f"x is y: {x is y}") # True (cached integers)

x = 1000 y = 1000 print(f"x is y: {x is y}") # False (not cached)

Common use case: checking for None

value = None print(f"value is None: {value is None}") # True (recommended) print(f"value == None: {value == None}") # True (but not recommended) `

Best Practices for Identity Operators

- Use is and is not primarily for comparing with None, True, and False - Use == and != for value comparisons - Be aware of Python's object caching for small integers and strings

Membership Operators

Membership operators are used to test if a value is present in a sequence (strings, lists, tuples, sets, dictionaries).

Membership Operators Table

| Operator | Description | Example | Result | |----------|-------------|---------|--------| | in | Returns True if value is found in sequence | 'a' in 'apple' | True | | not in | Returns True if value is not found in sequence | 'z' not in 'apple' | True |

Examples with Different Data Types

`python

String membership

text = "Hello World" print(f"'H' in text: {'H' in text}") # True print(f"'xyz' in text: {'xyz' in text}") # False print(f"'World' in text: {'World' in text}") # True

List membership

numbers = [1, 2, 3, 4, 5] print(f"3 in numbers: {3 in numbers}") # True print(f"6 not in numbers: {6 not in numbers}") # True

Tuple membership

coordinates = (10, 20, 30) print(f"20 in coordinates: {20 in coordinates}") # True

Set membership (most efficient for large collections)

fruits = {'apple', 'banana', 'orange'} print(f"'apple' in fruits: {'apple' in fruits}") # True

Dictionary membership (checks keys by default)

person = {'name': 'John', 'age': 30, 'city': 'New York'} print(f"'name' in person: {'name' in person}") # True print(f"'John' in person: {'John' in person}") # False (value, not key) print(f"'John' in person.values(): {'John' in person.values()}") # True

Range membership

range_obj = range(1, 11) print(f"5 in range_obj: {5 in range_obj}") # True print(f"15 in range_obj: {15 in range_obj}") # False `

Performance Considerations

Different data structures have different performance characteristics for membership testing:

| Data Structure | Average Time Complexity | Notes | |----------------|-------------------------|-------| | List | O(n) | Linear search | | Tuple | O(n) | Linear search | | Set | O(1) | Hash table lookup | | Dictionary | O(1) | Hash table lookup (keys) | | String | O(n) | Substring search |

`python

Performance example

import time

Large list vs set comparison

large_list = list(range(100000)) large_set = set(range(100000))

Searching in list

start_time = time.time() result = 99999 in large_list list_time = time.time() - start_time

Searching in set

start_time = time.time() result = 99999 in large_set set_time = time.time() - start_time

print(f"List search time: {list_time:.6f} seconds") print(f"Set search time: {set_time:.6f} seconds") `

Bitwise Operators

Bitwise operators work on binary representations of numbers at the bit level. They are useful for low-level programming, optimization, and working with binary data.

Bitwise Operators Table

| Operator | Name | Description | Example | Binary Operation | |----------|------|-------------|---------|------------------| | & | AND | Sets bit if both bits are 1 | 5 & 3 = 1 | 101 & 011 = 001 | | \| | OR | Sets bit if at least one bit is 1 | 5 \| 3 = 7 | 101 \| 011 = 111 | | ^ | XOR | Sets bit if bits are different | 5 ^ 3 = 6 | 101 ^ 011 = 110 | | ~ | NOT | Inverts all bits | ~5 = -6 | ~101 = ...11111010 | | << | Left Shift | Shifts bits left | 5 << 1 = 10 | 101 << 1 = 1010 | | >> | Right Shift | Shifts bits right | 5 >> 1 = 2 | 101 >> 1 = 10 |

Detailed Examples

`python

Binary representations

a = 5 # Binary: 101 b = 3 # Binary: 011

print(f"a = {a}, binary: {bin(a)}") # 0b101 print(f"b = {b}, binary: {bin(b)}") # 0b011

Bitwise AND

result_and = a & b # 101 & 011 = 001 print(f"a & b = {result_and}, binary: {bin(result_and)}") # 1

Bitwise OR

result_or = a | b # 101 | 011 = 111 print(f"a | b = {result_or}, binary: {bin(result_or)}") # 7

Bitwise XOR

result_xor = a ^ b # 101 ^ 011 = 110 print(f"a ^ b = {result_xor}, binary: {bin(result_xor)}") # 6

Bitwise NOT

result_not_a = ~a # ~101 = ...11111010 (two's complement) print(f"~a = {result_not_a}, binary: {bin(result_not_a)}") # -6

Left shift

result_left = a << 2 # 101 << 2 = 10100 print(f"a << 2 = {result_left}, binary: {bin(result_left)}") # 20

Right shift

result_right = a >> 1 # 101 >> 1 = 10 print(f"a >> 1 = {result_right}, binary: {bin(result_right)}") # 2 `

Practical Applications

`python

Check if number is even or odd using bitwise AND

def is_even(n): return (n & 1) == 0

print(f"4 is even: {is_even(4)}") # True print(f"5 is even: {is_even(5)}") # False

Fast multiplication and division by powers of 2

number = 12 print(f"{number} * 4 = {number << 2}") # Left shift by 2 = multiply by 4 print(f"{number} / 4 = {number >> 2}") # Right shift by 2 = divide by 4

Swap two numbers without temporary variable

x = 10 y = 20 print(f"Before swap: x={x}, y={y}")

x = x ^ y y = x ^ y x = x ^ y print(f"After swap: x={x}, y={y}")

Set, clear, and toggle specific bits

def set_bit(num, pos): return num | (1 << pos)

def clear_bit(num, pos): return num & ~(1 << pos)

def toggle_bit(num, pos): return num ^ (1 << pos)

number = 5 # Binary: 101 print(f"Original: {number} ({bin(number)})") print(f"Set bit 1: {set_bit(number, 1)} ({bin(set_bit(number, 1))})") print(f"Clear bit 2: {clear_bit(number, 2)} ({bin(clear_bit(number, 2))})") print(f"Toggle bit 1: {toggle_bit(number, 1)} ({bin(toggle_bit(number, 1))})") `

Operator Precedence

Operator precedence determines the order in which operators are evaluated in expressions. Understanding precedence is crucial for writing correct expressions and avoiding unexpected results.

Operator Precedence Table (Highest to Lowest)

| Precedence | Operator | Description | |------------|----------|-------------| | 1 | () | Parentheses | | 2 | | Exponentiation | | 3 | +x, -x, ~x | Unary plus, minus, bitwise NOT | | 4 | *, /, //, % | Multiplication, division, floor division, modulus | | 5 | +, - | Addition, subtraction | | 6 | <<, >> | Bitwise shifts | | 7 | & | Bitwise AND | | 8 | ^ | Bitwise XOR | | 9 | \| | Bitwise OR | | 10 | ==, !=, <, <=, >, >=, is, is not, in, not in | Comparisons, identity, membership | | 11 | not | Logical NOT | | 12 | and | Logical AND | | 13 | or | Logical OR |

Examples Demonstrating Precedence

`python

Arithmetic precedence

result1 = 2 + 3 4 # 2 + (3 4) = 14 result2 = (2 + 3) 4 # (2 + 3) 4 = 20 print(f"2 + 3 * 4 = {result1}") print(f"(2 + 3) * 4 = {result2}")

Exponentiation precedence

result3 = 2 3 2 # 2 (3 2) = 2 9 = 512 result4 = (2 3) 2 # (2 3) 2 = 8 2 = 64 print(f"2 3 2 = {result3}") print(f"(2 3) 2 = {result4}")

Mixed operators

result5 = 10 + 5 2 2 # 10 + 5 (2 2) = 10 + 5 * 4 = 10 + 20 = 30 print(f"10 + 5 2 * 2 = {result5}")

Logical operators precedence

x = True y = False z = True

result6 = x or y and z # x or (y and z) = True or (False and True) = True or False = True result7 = (x or y) and z # (True or False) and True = True and True = True print(f"x or y and z = {result6}") print(f"(x or y) and z = {result7}")

Comparison and logical operators

a = 5 b = 10 c = 15

result8 = a < b and b < c # (a < b) and (b < c) = True and True = True result9 = a < b or b > c # (a < b) or (b > c) = True or False = True print(f"a < b and b < c = {result8}") print(f"a < b or b > c = {result9}") `

Best Practices for Operator Precedence

1. Use Parentheses: When in doubt, use parentheses to make your intentions clear 2. Break Complex Expressions: Split complex expressions into multiple lines 3. Know Common Precedence: Memorize the most common precedence rules

`python

Good practice: clear and readable

total = (price quantity) + (tax_rate price * quantity)

Instead of relying on precedence

total = price quantity + tax_rate price * quantity

Breaking complex expressions

condition = (age >= 18) and (has_license == True) and (vision_test_passed == True) `

Special Operators

Python includes several special operators that provide unique functionality for specific use cases.

Ternary Operator (Conditional Expression)

The ternary operator provides a concise way to write simple if-else statements.

`python

Syntax: value_if_true if condition else value_if_false

age = 20 status = "adult" if age >= 18 else "minor" print(f"Status: {status}") # Output: Status: adult

Multiple conditions

score = 85 grade = "A" if score >= 90 else "B" if score >= 80 else "C" if score >= 70 else "F" print(f"Grade: {grade}") # Output: Grade: B

With function calls

def get_max(a, b): return a if a > b else b

print(f"Maximum of 5 and 8: {get_max(5, 8)}") # Output: 8 `

Walrus Operator (Assignment Expression) - Python 3.8+

The walrus operator := allows assignment within expressions.

`python

Traditional approach

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] squared = [] for n in numbers: square = n 2 if square > 25: squared.append(square)

Using walrus operator

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] squared = [square for n in numbers if (square := n 2) > 25] print(squared) # [36, 49, 64, 81, 100]

In while loops

import random while (value := random.randint(1, 10)) != 5: print(f"Got {value}, trying again...") print("Finally got 5!") `

Practical Examples

Example 1: Calculator Program

`python def calculator(): print("Simple Calculator") print("Operations: +, -, , /, //, %, *") try: num1 = float(input("Enter first number: ")) operator = input("Enter operator: ") num2 = float(input("Enter second number: ")) if operator == '+': result = num1 + num2 elif operator == '-': result = num1 - num2 elif operator == '*': result = num1 * num2 elif operator == '/': if num2 != 0: result = num1 / num2 else: return "Error: Division by zero!" elif operator == '//': if num2 != 0: result = num1 // num2 else: return "Error: Division by zero!" elif operator == '%': if num2 != 0: result = num1 % num2 else: return "Error: Division by zero!" elif operator == '': result = num1 num2 else: return "Error: Invalid operator!" return f"{num1} {operator} {num2} = {result}" except ValueError: return "Error: Invalid input!"

Example usage (commented out for documentation)

print(calculator())

`

Example 2: Grade Calculator with Multiple Operators

`python def calculate_grade(scores): if not scores: return "No scores provided" # Using arithmetic operators total = sum(scores) average = total / len(scores) # Using comparison operators and logical operators if average >= 90 and all(score >= 0 for score in scores): grade = 'A' elif average >= 80: grade = 'B' elif average >= 70: grade = 'C' elif average >= 60: grade = 'D' else: grade = 'F' # Using membership operators failing_scores = [score for score in scores if score < 60] has_failing = len(failing_scores) > 0 # Using ternary operator status = "Needs improvement" if has_failing else "Good performance" return { 'average': round(average, 2), 'grade': grade, 'total_scores': len(scores), 'failing_count': len(failing_scores), 'status': status }

Example usage

student_scores = [85, 92, 78, 96, 88] result = calculate_grade(student_scores) print(f"Grade Report: {result}") `

Example 3: Bitwise Operations for Permissions System

`python class PermissionSystem: # Permission constants using bitwise values READ = 1 # 001 WRITE = 2 # 010 EXECUTE = 4 # 100 def __init__(self): self.permissions = 0 def grant_permission(self, permission): """Grant a permission using bitwise OR""" self.permissions |= permission def revoke_permission(self, permission): """Revoke a permission using bitwise AND with NOT""" self.permissions &= ~permission def has_permission(self, permission): """Check if permission exists using bitwise AND""" return (self.permissions & permission) != 0 def toggle_permission(self, permission): """Toggle a permission using bitwise XOR""" self.permissions ^= permission def get_permissions_string(self): """Get human-readable permissions""" perms = [] if self.has_permission(self.READ): perms.append("READ") if self.has_permission(self.WRITE): perms.append("WRITE") if self.has_permission(self.EXECUTE): perms.append("EXECUTE") return ", ".join(perms) if perms else "NONE"

Example usage

user_perms = PermissionSystem()

Grant multiple permissions

user_perms.grant_permission(PermissionSystem.READ) user_perms.grant_permission(PermissionSystem.WRITE)

print(f"Current permissions: {user_perms.get_permissions_string()}") print(f"Has READ permission: {user_perms.has_permission(PermissionSystem.READ)}") print(f"Has EXECUTE permission: {user_perms.has_permission(PermissionSystem.EXECUTE)}")

Toggle EXECUTE permission

user_perms.toggle_permission(PermissionSystem.EXECUTE) print(f"After toggling EXECUTE: {user_perms.get_permissions_string()}")

Revoke WRITE permission

user_perms.revoke_permission(PermissionSystem.WRITE) print(f"After revoking WRITE: {user_perms.get_permissions_string()}") `

Summary

Python operators are fundamental tools that enable you to perform various operations on data. Understanding their behavior, precedence, and appropriate use cases is essential for writing efficient and readable Python code. Key takeaways include:

1. Arithmetic operators handle mathematical computations with important distinctions between / and // 2. Assignment operators provide shortcuts for common operations while modifying variables 3. Comparison operators enable conditional logic and data comparison 4. Logical operators combine conditions with short-circuit evaluation 5. Identity operators check object identity rather than value equality 6. Membership operators test for presence in sequences with varying performance characteristics 7. Bitwise operators manipulate data at the binary level for specialized applications 8. Operator precedence determines evaluation order, with parentheses providing explicit control

Mastering these operators will significantly improve your ability to write effective Python programs and solve complex problems efficiently.

Tags

  • Programming Basics
  • fundamentals
  • operators
  • syntax

Related Articles

Related Books - Expand Your Knowledge

Explore these Python books to deepen your understanding:

Browse all IT books

Popular Technical Articles & Tutorials

Explore our comprehensive collection of technical articles, programming tutorials, and IT guides written by industry experts:

Browse all 8+ technical articles | Read our IT blog

Complete Guide to Python Operators: Types &amp; Examples