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

Python Docs

The document provides an overview of Python programming, covering its applications in web and software development. It includes instructions on installation, syntax, data types, variables, operators, loops, functions, classes, and modules. Additionally, it touches on file handling and the use of comments in Python code.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views20 pages

Python Docs

The document provides an overview of Python programming, covering its applications in web and software development. It includes instructions on installation, syntax, data types, variables, operators, loops, functions, classes, and modules. Additionally, it touches on file handling and the use of comments in Python code.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PYTHON

So Why Python is used for?

Server side (Web Development):

Software Development:

Python Install: In Your Command Prompt-

C:\Users\Your Name>python –version

Execute Python Syntax:

Live data>>Open Idle in your computer

Python Indentation:

P yth on Ind enta tion


PYTHON

ERROR:

Python Comments:

To make comment press Ctrl + /

Multiline Comments:

Not Use Like this Instead


PYTHON

Python Variables:

Creating Variables:

Python - Variable Names:


PYTHON

Illegal Names:

Multi Words Variable Names:

1. Camel Case
2. Pascal Case
3. Snake Case

Python Variables - Assign Multiple Values:

Output Variables:

Python Data Types:

Built-in Data Types:


PYTHON

Getting the Data Type:


PYTHON

Setting the Data Type:

Python Numbers:
PYTHON

Python Casting:

Python Booleans:

When you run a condition in an if statement, Python returns True or False

Python Operators:
PYTHON

Python Comparison Operators:


PYTHON

Python Logical Operators:

Python Identity Operators:

Lists:
PYTHON

Allow Duplicates

List Length:

List Items - Data Types:

type():

Access Items:

Negative Indexing:

Range of Indexes:
PYTHON

Change Item Value:

Python - Add List Items:

Append Items

Insert Items:

Extend List

Remove Specified Item:


PYTHON

Remove Specified Index:

The del keyword can also delete the list completely.

Clear the List:

Python - Loop Lists

Loop Through a List

Loop Through the Index Numbers:

Using a While Loop:

LOOPS IN PYTHON
PYTHON

FOR LOOP:

Do-While loop:

Python Tuples:

Tuple Items - Data Types:

Python Sets:
PYTHON

Set

Duplicates Not Allowed

Python If ... Else:

Python LOOPs:

Python Functions:

Creating a Function:

Calling a Function:

Arguments , Parameters Difference??

Python Arrays:
PYTHON

Python Classes and Objects:

Create a Class:

Create Object:

Python Inheritance:

Create a Parent Class:


PYTHON

Create a Child Class:

Python Iterators:

Iterator vs Iterable

Lists, tuples, dictionaries, and sets are all iterable objects. They are
iterable containers which you can get an iterator from.

All these objects have a iter() method which is used to get an iterator

Python Polymorphism:

Function Polymorphism

For strings len() returns the number of characters:

For dictionaries len() returns the number of key/value pairs in the


dictionary:
PYTHON

Python Scope:

Local Scope

Global Scope:

Global Keyword:

Python Modules:

Create a Module [Link]

Use a Module:
PYTHON

Variables in Module:

Python Datetime:

Python File Open:

File Handling

[Link]

MORE..
PYTHON
PYTHON

You might also like