0% found this document useful (0 votes)
2 views13 pages

Python Coding Notes

The document provides an introduction to Python, highlighting its features such as simplicity, portability, and object-oriented nature. It covers basic syntax, data types, variables, operators, conditional statements, loops, functions, object-oriented programming, exception handling, file handling, and the use of modules and libraries. Each section includes code examples to illustrate the concepts discussed.

Uploaded by

jihoney579
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)
2 views13 pages

Python Coding Notes

The document provides an introduction to Python, highlighting its features such as simplicity, portability, and object-oriented nature. It covers basic syntax, data types, variables, operators, conditional statements, loops, functions, object-oriented programming, exception handling, file handling, and the use of modules and libraries. Each section includes code examples to illustrate the concepts discussed.

Uploaded by

jihoney579
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

Page 1: Introduction to Python

Python is a high-level, interpreted language known for simplicity.


Page 2: Features of Python

Easy syntax, Portable, Interpreted, Object-Oriented, Large libraries.


Page 3: Basic Syntax

Python uses indentation.

print('Hello World')
Page 4: Data Types

int, float, str, bool, list, tuple, dict, set.


Page 5: Variables

Variables store data.

x = 10
y = 'Hello'
Page 6: Operators

Arithmetic, Logical, Comparison operators.


Page 7: Conditional Statements

if, elif, else

if x>5:
print('Greater')
Page 8: Loops

for and while loops.

for i in range(5):
print(i)
Page 9: Functions

Reusable blocks of code.

def add(a,b):
return a+b
Page 10: OOP

Classes and Objects.

class Car:
def drive(self):
print('Driving')
Page 11: Exception Handling

try and except.

try:
10/0
except:
print('Error')
Page 12: File Handling

Read and write files.

f=open('[Link]','w')
[Link]('Hello')
Page 13: Modules & Libraries

Import modules using import keyword.

You might also like