Page 65 - Touhpad Ai
P. 65

u Underscore (_): Used as a variable name, or in naming conventions, such as snake_case.
                 u Hash (#): Used to create comments in Python code.
                 u At Sign (@): Used in decorators.
                 u Dollar Sign ($): Used in some Python libraries like pandas for referencing columns in data frames.

                 u Tilde (~): Used as the complement operator in bitwise operations.
                 u  Double Underscore (__): Used in special methods (dunder/magic methods) and sometimes for name mangling in
                   classes.
                 u Angle Brackets (< and >): Used for comparison operations.
                 u Vertical Bar or Pipe (|): Used in bitwise OR operations.
                 u Ampersand (&): Used in bitwise AND operations.
                 u Caret (^): Used in bitwise XOR operations.

                 u Double Period (..): Used in some libraries and frameworks for specifying ranges or intervals.
                 u Ellipsis (...): Used as a placeholder in some contexts, such as in NumPy arrays or as part of type hints.
                 u Minus-Equivalent (-=): Used in augmented assignment statements.
                 u Double Greater Than (>>) and Double Less Than (<<): Used in bit shifting operations.


                 Variables
                 In Python, variables are used to store and manipulate data values. Variables in Python do not have fixed locations in
                 memory. The memory location they refer to changes every time their values change.

                 Variable Assignment

                 Variables in Python are declared simply by assigning a value to them using the assignment operator (=).
                 Python syntax for assigning a value to a variable can be described as follows:
                   <Variable_name> = <value>
                 For example:
                   x = 10
                   name = "Yash"
                   my_list = [1, 2, 3, 4, 5]
                 Unlike some other programming languages, Python does not require explicit declaration of variables before they are used.
                 When a variable is assigned a value, Python automatically determines its data type based on the assigned value. Python
                 variables can hold values of various data types, including integers, floats, strings, booleans, lists, tuples, dictionaries,
                 and more.
                 For example:

                   # Integer variable
                   age = 30
                   # Float variable
                   pi = 3.14
                   # String variable
                   message = "Hello, World!"
                   # Boolean variable
                   is_student = True

                   # List variable
                   numbers = [1, 2, 3, 4, 5]

                                                                                 Basic Concepts of Artificial Intelligence  63
   60   61   62   63   64   65   66   67   68   69   70