- 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
TYPE CASTING
Convert to integer
float_num = 3.14
int_num = int(float_num)
print(int_num) # Output: 3
convert to float
int_num = 5
float_num = float(int_num)
print(float_num) # Output: 5.0
convert to string
number = 42
str_num = str(number)
print(str_num) # Output: '42'
convert to boolean
num = 0
bool_value = bool(num)
print(bool_value) # Output: False
convert to complex
int_num = 2
complex_num = complex(int_num)
print(complex_num) # Output: (2+0j)
convert to list,tuple,set
string = "hello"
list_chars = list(string)
tuple_chars = tuple(string)
set_chars = set(string)
print(list_chars) # Output: ['h', 'e', 'l', 'l', 'o']
print(tuple_chars) # Output: ('h', 'e', 'l', 'l', 'o')
print(set_chars) # Output: {'h', 'e', 'l', 'o'}
convert to/from ascii
char = 'A'
ascii_value = ord(char)
char_again = chr(ascii_value)
print(ascii_value) # Output: 65
print(char_again) # Output: 'A'