- INTRODUCING
- PYTHON BASICS
- DATA STRUCTURES
- FUNCTIONS AND MODULES
- DEFINING AND CALLING FUNCTIONS
- PARAMETERS AND RETURN VALUES
- VARIABLE SCOPE AND GLOBAL/LOCAL VARIABLES
- IMPORTING AND USING MODULES
- CREATING AND USING CUSTOM MODULES
- FILE HANDLING:
- OBJECT-ORIENTED PROGRAMMING (OOP)
- INTRODUCTION TO OOP CONCEPTS
- CLASSES, OBJECTS, AND ATTRIBUTES
- INHERITANCE AND POLYMORPHISM
- ENCAPSULATION AND DATA HIDING
- OVERLOADING AND OVERRIDING METHODS
- ERROR HANDLING
- UNDERSTANDING EXCEPTIONS AND ERRORS
- TRY-EXCEPT BLOCKS AND HANDLING EXCEPTIONS
- RAISING CUSTOM EXCEPTIONS
- PYTHON LIBRARIES
- INTRODUCTION TO POPULAR LIBRARIES LIKE NUMPY, PANDAS, AND MATPLOTLIB
- DATA MANIPULATION WITH NUMPY AND PANDAS
- DATA VISUALIZATION WITH MATPLOTLIB
- INTERFACING TO THE OS
- PROCESSSING INFORMATIONS
- WORKING WITH FILES
- DATA MANGEMENT AND STORAGE
- COMMUNICATION OVER A NETWORK
- PYTHON INTERVIEW
- BASICS OF PROGRAMING
- WHAT IS PROGRAMMING
- WHY WE NEED TO LEARN PROGRAMING
- BENEFITS OF LEARNING PROGRAMING
- SOME EXAMPLES OF PROGRAMING
- EXAMPLE OF BASIC CODING IN PYTHON PROGRAMING
- PYTHON INTRODUCTION
- COMMENTS IN PYTHON
- VARIABLE IN PYTHON
- DATA TYPES IN PYTHON
- NUMBERS IN PYTHON
- TYPE CASTING IN PYTHON
- STRING IN PYTHON
- BOOLEAN IN PYTHON
- OPERATORS IN PYTHON
- DATA STRUCTURE IN PYTHON
- CONDITIONAL STATEMENT IN PYTHON
- LOOPS IN PYTHON
- FUNCTION IN PYTHON
- LAMBDA IN PYTHON
- ARRAY IN PYTHON
- DATA STRUCTURE IN PYTHON
NUMBERS
Numbers are a fundamental data type used to represent numeric values.
There are three main types of numbers in Python:
1.int
2.float
3.complex
x=10 #int
y=5.6 #float
z=2j #complex
Arithmetic operations on numbers.
Python supports various arithmetic operations on numbers:
# Addition
sum_result = 5 + 3
# Subtraction
difference_result = 7 - 2
# Multiplication
product_result = 4 * 6
# Division
quotient_result = 9 / 2 # Returns a float
# Floor Division (returns the quotient as an integer)
floor_result = 9 // 2
# Modulus (returns the remainder)
remainder_result = 9 % 2
# Exponentiation
power_result = 2 ** 3 # 2 raised to the power of 3
Type Conversion:
You can convert between different numeric types using functions like int()
, float()
, and complex()
.
# Convert float to int
int_value = int(3.14)
# Convert int to float
float_value = float(5)
# Convert int to complex
complex_value = complex(2)