0% found this document useful (0 votes)
1 views3 pages

Python Detailed Notes

This document provides a comprehensive overview of Python, covering its introduction, basics, operators, control structures, functions, data structures, string operations, object-oriented programming, modules, file handling, exception handling, built-in functions, useful libraries, environments, and advanced topics. It highlights Python's features such as being high-level, interpreted, and easy to learn, along with examples of syntax and usage. The document serves as a detailed reference for both beginners and experienced programmers.

Uploaded by

Ruturaj Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views3 pages

Python Detailed Notes

This document provides a comprehensive overview of Python, covering its introduction, basics, operators, control structures, functions, data structures, string operations, object-oriented programming, modules, file handling, exception handling, built-in functions, useful libraries, environments, and advanced topics. It highlights Python's features such as being high-level, interpreted, and easy to learn, along with examples of syntax and usage. The document serves as a detailed reference for both beginners and experienced programmers.

Uploaded by

Ruturaj Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Python Detailed Notes

1. Introduction to Python
- High-level, interpreted, and easy to learn.

- Dynamically typed, object-oriented.

- Portable, open-source, and has a large standard library.

2. Python Basics
Variables: x = 10, name = 'Alice'

Data Types: int, float, str, bool, list, tuple, set, dict

Type Casting: int('5'), str(10), float('3.14')

3. Operators
Arithmetic: + - * / // % **

Comparison: == != > < >= <=

Logical: and, or, not

Assignment: = += -=

Membership: in, not in

Identity: is, is not

4. Control Structures
If-else: if cond:

Loops: for i in range(), while cond

Loop Control: break, continue, pass

5. Functions
def greet(name):

return 'Hello ' + name

Lambda: square = lambda x: x**2


6. Data Structures
List: [1, 2, 3], .append()

Tuple: (1, 2)

Set: {1, 2, 3}

Dict: {'name': 'Rutu'}

7. String Operations
s = 'Python'

s.upper(), s[0:3], s.replace('P', 'J')

8. OOP in Python
class Car:

def __init__(self, brand):

self.brand = brand

def drive(self):

print(self.brand)

obj = Car('BMW')

9. Modules and Packages


import math

math.sqrt(25)

Custom: import mymodule

10. File Handling


with open('file.txt', 'r') as f:

print(f.read())

Modes: r, w, a, r+

11. Exception Handling


try:

x=1/0

except ZeroDivisionError:

print('Error')

finally:

print('Done')

12. Built-in Functions


len(), range(), type(), id(), sum(), max(), min(), input(), print()

13. Useful Libraries


Data: pandas, numpy

ML: sklearn, tensorflow

Web: flask, django

Auto: selenium, pyautogui

14. Python Environments


IDEs: VSCode, PyCharm

pip install package

Virtualenv: python -m venv env

15. Advanced Topics


Decorators, Generators, List Comprehensions, Regex, Threading, APIs, tkinter

You might also like