Python
Python
• Interpreted Language: Python code is executed line by line, which simplifies debugging and
testing.
• Dynamically Typed: You don't need to declare variable types; Python determines them
automatically at runtime.
• High-Level Language: Python offers a high level of abstraction, allowing you to focus on the
logic and functionality of your code without worrying about low-level details.
• Open Source and Free: Python is free to use and distribute, and its source code is readily
available for modification and customization.
• Extensive Standard Library: Python includes a vast collection of pre-built modules and
functions for various tasks, reducing the need for external dependencies.
• Large Community Support: Python has a large and active community that provides
resources, libraries, and tools, making it easier to find help and solutions.
• Versatile Applications: Python is used in various fields, including web development, data
science, machine learning, automation, and more.
• GUI Support: Python can be used to create graphical user interfaces (GUIs) for desktop
applications.
• Scalable: Python can handle large and complex projects, and its libraries can be used to
create scalable applications.
Operators in Python
Operators in Python are special symbols that carry out arithmetic or logical computations.
Here's a breakdown of different types of operators:
Arithmetic Operators: These operators perform basic mathematical operations:
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus (remainder of division)
// Floor division (quotient of division rounded down)
** Exponentiation
Assignment Operators :These operators assign values to variables:
= Assignment
+= Add and assign
-= Subtract and assign
*= Multiply and assign
/= Divide and assign
%= Modulus and assign
//= Floor divide and assign
**= Exponentiate and assign
Comparison Operators:These operators compare values and return a boolean result:
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
Logical Operators: These operators combine boolean expressions: and Logical AND, or
Logical OR, and not Logical NOT.
Bitwise Operators: These operators perform bit-level operations on integers:
& Bitwise AND, | Bitwise OR, ^ Bitwise XOR, ~ Bitwise NOT, << Left shift, and >> Right shift.
Identity Operators: These operators compare the memory locations of objects:
is Returns True if both variables are the same object
is not Returns True if both variables are not the same object
Membership Operators: These operators check if a value is present in a sequence:
in Returns True if a value is found in the sequence
not in Returns True if a value is not found in the sequence
Codes:
**** Note: kindly refer the topics for basics of python. Go through the detailed study of
each topic from other sources too.****