KEMBAR78
Class 3 | PDF | Python (Programming Language) | Object Oriented Programming
0% found this document useful (0 votes)
3 views7 pages

Class 3

Uploaded by

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

Class 3

Uploaded by

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

Developer of python : Guido van rossum

Feb 20th 1991

The name originated from a show called as Monte python circus

Python is functional programing language borrowed from c language

It is scripting language borrowed from shell

It is modular programming language borrowed from modula

It is Object oriented programming language borrowed from c++

Basically python is built by using c language and ABC language.

We can use python for developing

Web applns
Mobile Applns
Networking Applns
Data Science and Machine Learning
AI Applns
IOT Applns

The companies which are using Python are

Google, Netflix , facebook, Dropbox etc

Features of Python

1. Simple and easy to learn(LKG level)

Python has a clean and readable syntax that closely resembles plain English.
This makes it easy for absolute beginners, even at the level of Lower Kindergarten
(LKG, metaphorically),
to start learning programming without getting overwhelmed.

2.Freeware and open source

Python is distributed under an open-source license (specifically the Python


Software Foundation License),
which means:

You can download, use, and distribute it for free.

You can view and modify the source code.

It encourages community collaboration for development.

3.High level programming language

Python is a high-level language, meaning:

You don’t need to manage memory allocation, CPU registers, or other low-level
details.

It handles most of the technical backend tasks automatically.

It allows you to focus on solving problems rather than managing the computer's
hardware.

4.Platform Independent

Python is cross-platform, which means:

You can write Python code on Windows, Mac, or Linux...

...and run it on any other system with a Python interpreter, without changing your
code.

5.Portable

Portability means you can:

Move your Python program from one system to another and run it seamlessly.

Distribute your Python program to users with different operating systems.

6.Dynamically Typed programming Language

In Python, you don’t need to declare variable types explicitly. The type is
determined at runtime, based on the value assigned.

x = 10 # Integer
x = "Hello" # Now it's a string

7.Both Procedure Oriented and Object Oriented

Python supports both:

Procedural Programming: Writing functions and code blocks (e.g., C-style).

Object-Oriented Programming (OOP): Organizing code into classes and objects (e.g.,
Java-style).

# Procedural
def greet():
print("Hello")

# Object-Oriented
class Greeter:
def greet(self):
print("Hello")

8.Interpreted

Python is not compiled to machine code beforehand. Instead:


It runs line-by-line using an interpreter.

You get instant feedback, which helps in testing and debugging.

Slower than compiled languages, but easier to develop

9.Extensible

Python can extend its capabilities by:

Integrating code written in C or C++.

Using external modules to add new features (like image processing, data science,
etc.)

This is useful when performance is critical or when integrating with legacy


systems.

10.Embedded

Python can be embedded inside other programs written in different languages like C
or C++.

This allows those applications to run Python scripts internally.

It adds scripting capabilities to applications.

11.Extensive library support

Python comes with a vast Standard Library plus third-party packages for:

Web development (Django, Flask)

Data science (NumPy, Pandas, Matplotlib)

Machine learning (Scikit-learn, TensorFlow)

Automation (Selenium, PyAutoGUI)

Networking, file I/O, and more

Limitations:
---------------------------
1. performance wise python is not up to the mark, because it is interpreted
language.
Interpreter can be able to see only one line

2.It is not being used for mobile Applns.

Myth : is not used for building large scale applns


------------------------------------------------------
Since python is open source , all can modify it and create thier own versions
Flavours of python

1.Cpython : Stardard flavour of python , to work with c language applns.

2.Jython/JPython : The flavour of python which words with java programs

There is no support for python 3.0 in jython

3.IronPython : This flavour of python is developed to work with C#(.net) applns

4.pypy : If we want high performance version of python we use pypy(where just like
in java jit is there right in the same wat we have some interpreter in python)
Inside pvm we have a jit compiler

5.RubyPython : This falvour of python is developed to work with ruby

6.AnacondaPython : To handle big data, we can go for AnacondaPython

7.Stackless: Python for concurrency , to execute the things parallely just like
multithreading

| Implementation | Written In | Runs On | Python Version | Key Feature


/ Use Case | C Extension Support | JIT Support | Integration
With |
|-------------------|------------|-------------------|----------------|------------
---------------------------------|---------------------|-------------|-------------
-----|
| CPython | C | Native OS | 3.x | Default &
standard implementation | ✅ Yes | ❌ No | C/C++
|
| Jython | Java | Java JVM | 2.x | Integrate
Python with Java code | ❌ No | ❌ No | Java
|
| IronPython | C# | .NET CLR | 2.7 / 3.x (dev)| Integrate
Python with .NET | ❌ No | ❌ No | .NET (C#, VB)
|
| PyPy | RPython | Native OS | 3.x compatible | High
performance with JIT compilation | ⚠️ Partial | ✅ Yes | Python
Ecosystem |
| RubyPython | Python/C | Native OS | 2.x | Bridge
between Python and Ruby | ✅ (via CPython) | ❌ No | Ruby
|
| Anaconda Python | C | Native OS | 3.x | CPython +
data science libs pre-installed | ✅ Yes | ❌ No | Data science
|
| Stackless Python | C(modified)| Native OS | 3.x | Lightweight
microthreads (tasklets) | ✅ Yes | ❌ No | CPython
|

Python versions :

Python has three major released versions

Python 1.0 introduced in jan 1994

Python 2.0 introduced in october 2000


Python 3.0 introduced in Dec 2008

Python 3.6.3 ===> 2016

Any software principle is The new version should provide support for old version
programs.

This is the first language where there is no backward compatibility

Python 2 never going to work for python 3

print "Hello" valid in python-2 , but invalid in python-3

long data type is there in python-2 but not there in python-3


------------------------------------------------------------------------

The growing market of python is beacuse of python-3

The version recomended to use is python-3

Identifiers :
--------------

The names given to the components of python


For the identification purpose

if we take x = 10

where x is nothing but name, which is an identifier

def f1():
pass

f1 is the identifier of the function

class Test:

Test is the name of the class.

A name in python program is called as an identifier.

It can be variable name, class Name or method name

let us take an example of kid.

While naming a kid , we follow several rules.

In india especially we follow certain rules.

We might keep god name, or ancestor name etc

We can't name our kids , a dog name or cat name.

So we need to follow certain rules to keep identifier for python.

Rules to define identifier in python


-------------------------------------
1.alphabet symbols(Both uppercase and lowercase)
Digits(0 to 9)
underscore(_)

valid syntax : cash =10


invalid syntax : cash$ = 10

2.Identifier should not start with a digit


valid syntax : total123 = 10
invalid syntax : 123total = 10

3.
Python is a case sensitive language
total = 10
TOTAL = 20
both are different variables, they are not same.

4.No predefined words can be used as identifiers


valid syntax : x = 10
invalid syntax : if = 20

5.The characters length of a identifier is unlimited , but it is not at all


rcommended to take too lengthy identifiers.
The readability of the code is going to be down.

123total invalid
total123 valid
java$share invalid
ca$h invalid
_abc_abc_ valid
def invalid
if invalid

If the identifier starts with _ symbol then it is private

_ ==> private

If the identifier starts with __ two underscore symbols then it is strongly private

_ _ ==> strongly private

__main__ ==> starts and ends with two underscore symbols.


It is the language speicific idnetifier.

Special variable defined by python itself

You might also like