Programming Language: Python
Interface IDE: VS Code, Jupyter Notebooks
https://colab.research.google.com/
=
operator is used.In Python, there are naming conventions for variables and functions:
name_like_this (snake_case) - Used for variable and function names.
name.like.this - Not used in Python.
name like this - Wrong naming convention in Python.
Operation | Description | Operation | Description | |
---|---|---|---|---|
a == b | a equal to b | a != b | a not equal to b | |
a < b | a less than b | a > b | a greater than b | |
a <= b | a less than or equal to b | a >= b | a greater than or equal to b |
Logical operators are used for comparisons and logical operations.
==
is used to check if two values are equal.<
is used to check if one value is less than another.>
is used to check if one value is greater than another.
or
is used for logical OR operations.
and
is used for logical AND operations.Operator | Name | Description |
---|---|---|
a + b | Addition | Sum of a and b |
a - b | Subtraction | Difference of a and b |
a * b | Multiplication | Product of a and b |
a / b | True division | Quotient of a and b |
a // b | Floor division | Quotient of a and b, removing fractional parts |
a % b | Modulus | Integer remainder after division of a by b |
a ** b | Exponentiation | a raised to the power of b |
-a | Negation | The negative of a |
+a | Unary plus | a unchanged (rarely used) |
()
.–> –> –> –> –>
You can install Matplotlib using pip:
You can install Seaborn using pip:
import seaborn as sns
import matplotlib.pyplot as plt
# Sample data
categories = ['A', 'B', 'C', 'D']
values = [10, 5, 12, 7]
# Create a bar plot
sns.barplot(x=categories, y=values)
# Add labels and a title
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Simple Bar Plot')
# Display the plot
plt.show()