Enviar búsqueda
Cargar
Python Introduction - An Easy Programming Language to Learn
•
8 recomendaciones
•
12,827 vistas
Título mejorado por IA
Arulalan T
Seguir
Tecnología
Educación
Denunciar
Compartir
Denunciar
Compartir
1 de 109
Descargar ahora
Descargar para leer sin conexión
Recomendados
Functions in python slide share
Functions in python slide share
Devashish Kumar
Python ppt
Python ppt
Rohit Verma
Phython Programming Language
Phython Programming Language
R.h. Himel
Python Seminar PPT
Python Seminar PPT
Shivam Gupta
Python presentation by Monu Sharma
Python presentation by Monu Sharma
Mayank Sharma
Python Programming Language
Python Programming Language
Dr.YNM
Python strings
Python strings
Mohammed Sikander
Python Basics
Python Basics
tusharpanda88
Recomendados
Functions in python slide share
Functions in python slide share
Devashish Kumar
Python ppt
Python ppt
Rohit Verma
Phython Programming Language
Phython Programming Language
R.h. Himel
Python Seminar PPT
Python Seminar PPT
Shivam Gupta
Python presentation by Monu Sharma
Python presentation by Monu Sharma
Mayank Sharma
Python Programming Language
Python Programming Language
Dr.YNM
Python strings
Python strings
Mohammed Sikander
Python Basics
Python Basics
tusharpanda88
Python training
Python training
Kunalchauhan76
Python OOPs
Python OOPs
Binay Kumar Ray
Benefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of python
paradisetechsoftsolutions
C++ Overview PPT
C++ Overview PPT
Thooyavan Venkatachalam
Array in c
Array in c
Ravi Gelani
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
Python Summer Internship
Python Summer Internship
Atul Kumar
Python Presentation
Python Presentation
Narendra Sisodiya
Python ppt
Python ppt
Rachit Bhargava
Python basic
Python basic
SOHIL SUNDARAM
Conditional and control statement
Conditional and control statement
narmadhakin
Introduction to-python
Introduction to-python
Aakashdata
Basics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
Overview of python 2019
Overview of python 2019
Samir Mohanty
Fundamentals of Python Programming
Fundamentals of Python Programming
Kamal Acharya
Python - An Introduction
Python - An Introduction
Swarit Wadhe
programming with python ppt
programming with python ppt
Priyanka Pradhan
Python basic
Python basic
Saifuddin Kaijar
Python tutorial
Python tutorial
Vijay Chaitanya
Strings in python
Strings in python
Prabhakaran V M
Python object oriented programming (lab2) (2)
Python object oriented programming (lab2) (2)
iloveallahsomuch
Object oriented programming with python
Object oriented programming with python
Arslan Arshad
Más contenido relacionado
La actualidad más candente
Python training
Python training
Kunalchauhan76
Python OOPs
Python OOPs
Binay Kumar Ray
Benefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of python
paradisetechsoftsolutions
C++ Overview PPT
C++ Overview PPT
Thooyavan Venkatachalam
Array in c
Array in c
Ravi Gelani
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
Python Summer Internship
Python Summer Internship
Atul Kumar
Python Presentation
Python Presentation
Narendra Sisodiya
Python ppt
Python ppt
Rachit Bhargava
Python basic
Python basic
SOHIL SUNDARAM
Conditional and control statement
Conditional and control statement
narmadhakin
Introduction to-python
Introduction to-python
Aakashdata
Basics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
Overview of python 2019
Overview of python 2019
Samir Mohanty
Fundamentals of Python Programming
Fundamentals of Python Programming
Kamal Acharya
Python - An Introduction
Python - An Introduction
Swarit Wadhe
programming with python ppt
programming with python ppt
Priyanka Pradhan
Python basic
Python basic
Saifuddin Kaijar
Python tutorial
Python tutorial
Vijay Chaitanya
Strings in python
Strings in python
Prabhakaran V M
La actualidad más candente
(20)
Python training
Python training
Python OOPs
Python OOPs
Benefits & features of python |Advantages & disadvantages of python
Benefits & features of python |Advantages & disadvantages of python
C++ Overview PPT
C++ Overview PPT
Array in c
Array in c
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
Python Summer Internship
Python Summer Internship
Python Presentation
Python Presentation
Python ppt
Python ppt
Python basic
Python basic
Conditional and control statement
Conditional and control statement
Introduction to-python
Introduction to-python
Basics of c++ Programming Language
Basics of c++ Programming Language
Overview of python 2019
Overview of python 2019
Fundamentals of Python Programming
Fundamentals of Python Programming
Python - An Introduction
Python - An Introduction
programming with python ppt
programming with python ppt
Python basic
Python basic
Python tutorial
Python tutorial
Strings in python
Strings in python
Destacado
Python object oriented programming (lab2) (2)
Python object oriented programming (lab2) (2)
iloveallahsomuch
Object oriented programming with python
Object oriented programming with python
Arslan Arshad
Advance OOP concepts in Python
Advance OOP concepts in Python
Sujith Kumar
Python: Basic Inheritance
Python: Basic Inheritance
Damian T. Gordon
Python: Multiple Inheritance
Python: Multiple Inheritance
Damian T. Gordon
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
Destacado
(6)
Python object oriented programming (lab2) (2)
Python object oriented programming (lab2) (2)
Object oriented programming with python
Object oriented programming with python
Advance OOP concepts in Python
Advance OOP concepts in Python
Python: Basic Inheritance
Python: Basic Inheritance
Python: Multiple Inheritance
Python: Multiple Inheritance
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Similar a Python Introduction - An Easy Programming Language to Learn
Python an-intro youtube-livestream-day1
Python an-intro youtube-livestream-day1
MAHALAKSHMI P
Why should you learn to python programming?
Why should you learn to python programming?
sakshichaudhary58
Python Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
Python Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
Python Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
Python basics
Python basics
ssuser4e32df
Python Programming Introduction For Students
Python Programming Introduction For Students
ShaunakBale1
Features of Python.pdf
Features of Python.pdf
SudhanshiBakre1
Python
Python
Learnbay Datascience
637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptx
Arjun123Bagri
Python Programming
Python Programming
shahid sultan
Intro to Python
Intro to Python
primeteacher32
Machine learning session 1
Machine learning session 1
NirsandhG
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
HaythamBarakeh1
Introduction to python
Introduction to python
AnirudhaGaikwad4
Govind.ppt.pptx
Govind.ppt.pptx
ShivKaushik8
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
Python Training in Chandigarh
Python Training in Chandigarh
Excellence Technology
Beginning python programming
Beginning python programming
kanteshraj
Introduction to python
Introduction to python
Soba Arjun
Similar a Python Introduction - An Easy Programming Language to Learn
(20)
Python an-intro youtube-livestream-day1
Python an-intro youtube-livestream-day1
Why should you learn to python programming?
Why should you learn to python programming?
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python Programming Part 1.pdf
Python basics
Python basics
Python Programming Introduction For Students
Python Programming Introduction For Students
Features of Python.pdf
Features of Python.pdf
Python
Python
637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptx
Python Programming
Python Programming
Intro to Python
Intro to Python
Machine learning session 1
Machine learning session 1
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
Introduction to python
Introduction to python
Govind.ppt.pptx
Govind.ppt.pptx
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Python Training in Chandigarh
Python Training in Chandigarh
Beginning python programming
Beginning python programming
Introduction to python
Introduction to python
Más de Arulalan T
wgrib2
wgrib2
Arulalan T
Climate Data Operators (CDO)
Climate Data Operators (CDO)
Arulalan T
CDAT - graphics - vcs - xmgrace - Introduction
CDAT - graphics - vcs - xmgrace - Introduction
Arulalan T
CDAT - cdms2, maskes, cdscan, cdutil, genutil - Introduction
CDAT - cdms2, maskes, cdscan, cdutil, genutil - Introduction
Arulalan T
CDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - Introduction
Arulalan T
Python an-intro-python-month-2013
Python an-intro-python-month-2013
Arulalan T
Thermohaline Circulation & Climate Change
Thermohaline Circulation & Climate Change
Arulalan T
Python an-intro - odp
Python an-intro - odp
Arulalan T
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-framework
Arulalan T
Pygrib documentation
Pygrib documentation
Arulalan T
Lesson1 python an introduction
Lesson1 python an introduction
Arulalan T
Python An Intro
Python An Intro
Arulalan T
Final review contour
Final review contour
Arulalan T
Contour Ilugc Demo Presentation
Contour Ilugc Demo Presentation
Arulalan T
Contour Ilugc Demo Presentation
Contour Ilugc Demo Presentation
Arulalan T
Edit/correct India Map In Cdat Documentation - With Edited World Map Data
Edit/correct India Map In Cdat Documentation - With Edited World Map Data
Arulalan T
Nomography
Nomography
Arulalan T
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
"contour.py" module
"contour.py" module
Arulalan T
contour analysis and visulaization documetation -1
contour analysis and visulaization documetation -1
Arulalan T
Más de Arulalan T
(20)
wgrib2
wgrib2
Climate Data Operators (CDO)
Climate Data Operators (CDO)
CDAT - graphics - vcs - xmgrace - Introduction
CDAT - graphics - vcs - xmgrace - Introduction
CDAT - cdms2, maskes, cdscan, cdutil, genutil - Introduction
CDAT - cdms2, maskes, cdscan, cdutil, genutil - Introduction
CDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - Introduction
Python an-intro-python-month-2013
Python an-intro-python-month-2013
Thermohaline Circulation & Climate Change
Thermohaline Circulation & Climate Change
Python an-intro - odp
Python an-intro - odp
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-framework
Pygrib documentation
Pygrib documentation
Lesson1 python an introduction
Lesson1 python an introduction
Python An Intro
Python An Intro
Final review contour
Final review contour
Contour Ilugc Demo Presentation
Contour Ilugc Demo Presentation
Contour Ilugc Demo Presentation
Contour Ilugc Demo Presentation
Edit/correct India Map In Cdat Documentation - With Edited World Map Data
Edit/correct India Map In Cdat Documentation - With Edited World Map Data
Nomography
Nomography
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
"contour.py" module
"contour.py" module
contour analysis and visulaization documetation -1
contour analysis and visulaization documetation -1
Último
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
SeasiaInfotech2
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ridwan Fadjar
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Fwdays
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Fwdays
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Hervé Boutemy
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
charlottematthew16
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Zilliz
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
The Digital Insurer
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Zilliz
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
hariprasad279825
Último
(20)
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
Python Introduction - An Easy Programming Language to Learn
1.
Python – An Introduction Arulalan.T arulalant@gmail.com Centre for Atmospheric Science Indian Institute of Technology Delhi
2.
Python is a Programming Language
3.
There are so many Programming Languages. Why Python?
4.
5.
6.
Python is simple and beautiful
7.
Python is Easy to Learn
8.
Python is Free Open Source Software
9.
Can Do ● Text Handling ●
System Administration ● GUI programming ● Web Applications ● Database Apps ● Scientific Applications ● Games ● NLP ● ...
10.
H i s t
o r y
11.
Guido van Rossum Father of Python 1991
12.
Perl Java Python Ruby PHP 1987 1991 1993 1995
13.
What is Python?
14.
Python is... A dynamic,open
source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
15.
Quick and Easy Intrepreted Scripting Language Variable declarations are unnecessary Variables are not typed Syntax is simple and consistent Memory management is automatic
16.
Object Oriented Programming Classes Methods Inheritance Modules etc.,
17.
Examples!
18.
19.
print “Hello World”
20.
No Semicolons !
21.
Variables colored_index_cards
22.
No Need to Declare Variable Types ! Python Knows Everything !
23.
value = 10 print value value = 100.50 print value value = “This is String ” print value * 3 # Oh !
24.
Input
25.
name = raw_input(“What
is Your name?”) print "Hello" , name , "Welcome"
26.
Indentation
27.
You have to follow the Indentation Correctly. Otherwise, Python will beat you !
28.
29.
Discipline Makes Good
30.
Flow
31.
if score >=
5000 : print “You win!” elif score <= 0 : print “You lose!” print “Game over.” else: print “Current score:”,score print “Donen”
32.
Loop
33.
for i in range(1, 5): print i else: print 'The for loop is over'
34.
Q) Print Multiplication Table of user defined number upto N times. Get both number & N from the User Hint : Use may use For / While Loop
35.
Soln) Print Multiplication Table of user defined number upto N times. no = int(raw_input(“Enter number ”)) N = int(raw_input(“Enter N value ”)) for i in range(1, N + 1): print “%d x %d = %d” % (i, no, i*no)
36.
number = 23 running = True while running : guess = int(raw_input('Enter an integer : ')) if guess == number : print 'Congratulations, you guessed it.' running = False elif guess < number : print 'No, it is a little higher than that.' else: print 'No, it is a little lower than that.' print 'Done'
37.
Q) What is the core purpose of while loop ?
38.
Q) What is the core purpose of while loop ? Ans) when the loop has to stop w.r.t certain condition/s. So the no of loops in “while loop” is dynamic / undefined one.
39.
Lets have some break
40.
Lets continue
41.
Array
42.
List = Array numbers = [ "zero", "one", "two", "three", "FOUR" ]
43.
List = Array numbers = [ "zero", "one", "two", "three", "FOUR" ] numbers[0] >>> zero numbers[4] numbers[1] >>> FOUR >>> FOUR numbers[2] >>> three
44.
Multi Dimension List numbers = [ ["zero", "one"], ["two", "three", "FOUR" ] ] numbers[0] >>> ["zero", "one"] numbers[0][0] numbers[1][1] >>> zero >>> FOUR len(numbers) >>> 2
45.
Sort List primes = [
11, 5, 7, 2, 13, 3 ]
46.
Sort List primes = [
11, 5, 7, 2, 13, 3 ] primes.sort()
47.
Sort List primes = [
11, 5, 7, 2, 13, 3 ] primes.sort() >>> [2, 3, 5, 7, 11, 13]
48.
Sort List names = [
"Shrini", "Bala", "Suresh", "Arul"] names.sort() >>> ["Arul", "Bala","Shrini","Suresh"] names.reverse() >>> ["Suresh","Shrini","Bala","Arul"]
49.
Mixed List names = [
"Shrini", 10, "Arul", 75.54] names[1]+10 >>> 20 names[2].upper() >>> ARUL
50.
Append on List numbers = [ 1,3,5,7] numbers.append(9) >>> [1,3,5,7,9]
51.
Tuples immutable
52.
names = ('Arul','Dhastha','Raj') name.append('Selva') Error : Can not modify the tuple Tuple is immutable type
53.
String
54.
name = 'Arul' name[0] >>>'A' myname = 'Arul' + 'alan' >>> 'Arulalan'
55.
name = 'This is python string' name.split(' ') >>> ['This', 'is', 'python', 'string'] comma = 'Shrini,Arul,Suresh' comma.split(',') >>> ['Shrini', 'Arul', 'Suresh'] split
56.
li = ['a','b','c','d'] new = ''.join(li) >>> 'abcd' new.split('') >>> ['a', 'b', 'c', 'd'] join
57.
'small'.upper() >>>'SMALL' 'BIG'.lower() >>> 'big' 'mIxEd'.swapcase() >>>'MiXwD'
58.
Dictionary
59.
menu = { “idly”
: 2.50, “dosai” : 10.00, “coffee” : 5.00, “ice_cream” : 5.00, 100 : “Hundred” } >>> menu[“idly”] 2.50 >>> menu[100] ”Hundred” >>> menu.get(“tea”, None) None
60.
uwind = { “latitude”
: (-90, 90), “longitude” : (0, 360), “level” : 850, “time” : “2013-07-17”, “units” : None } uwind.keys() uwind.values() for key, value in uwind.iteritems(): print key, ' = ', value
61.
Q) So tell me now, 'what is the use of dictionary ?'
62.
Q) So tell me now, 'what is the use of dictionary ?' Do you know dictionary can take even a function as value in it.
63.
Function
64.
def sayHello(): print 'Hello World!' # block belonging of fn # End of function sayHello() # call the function
65.
def printMax(a, b): if a > b: print a, 'is maximum' else: print b, 'is maximum' printMax(3, 4)
66.
def getMax(a, b): if a > b: return a print “I will not be printed” # end of if a > b: return b # end of def getMax(a, b): mymax = getMax(3, 4) print mymax
67.
Q) Write a function to print the passed argument number is even or odd...
68.
Q) Write a function to print the passed argument number is even or odd... def printEvenOrOdd(no): print “The passed no “, no, if no % 2 == 0: # condition print “ is even” else: print “ is odd” printEvenOrOdd(10)
69.
Using in built Modules
70.
#!/usr/bin/python # Filename: using_sys.py import time print 'The sleep started' time.sleep(3) print 'The sleep finished'
71.
#!/usr/bin/python import os os.listdir('/home/arulalan') os.mkdir('/home/arulalan/Fun') print dir(os)
72.
Making Our Own Modules
73.
#!/usr/bin/python # Filename: mymodule.py def sayhi(): print “Hi, this is mymodule speaking.” version = '0.1' # End of mymodule.py
74.
#!/usr/bin/python # Filename: mymodule_demo.py import mymodule mymodule.sayhi() print 'Version', mymodule.version
75.
#!/usr/bin/python # Filename: mymodule_demo2.py from mymodule import sayhi, version # Alternative: # from mymodule import * sayhi() print 'Version', version
76.
Class
77.
class Person: pass # An empty block p = Person() print p Classes
78.
class Person: def sayHi(self): print 'Hello, how are you?' p = Person() p.sayHi() Classes
79.
class Person: def __init__(self, name): #like contstructor self.name = name def sayHi(self): print 'Hello, my name is', self.name p = Person('Arulalan.T') p.sayHi() Classes
80.
Inheritance Classes
81.
class A: def hello(self): print ' I am super class ' class B(A): def bye(self): print ' I am sub class ' p = B() p.hello() p.bye() Classes
82.
class A: var = 10 def __init__(self): self.public = 100 self._protected_ = 'protected' self.__private__ = 'private' Class B(A): pass p = B() p.__protected__ Classes
83.
File Handling
84.
File Writing
85.
poem = ''' Programming is fun When the work is done if you wanna make your work also fun: use Python! ''' f = file('poem.txt', 'w') # open for 'w'riting f.write(poem) # write text to file f.close()
86.
Q) How can we write CSV files ? f = open('nos.csv', 'w') # open for 'w'riting for no in range(10): f.write(str(no) + ',' + str(no * no) + 'n') f.close()
87.
File Reading
88.
f = file('poem.txt','r') for line in f.readlines(): print line f.close()
89.
THE END of code :)
90.
How to learn ?
91.
Python – Shell ● Interactive Python ● Instance Responce ●
Learn as you type
92.
bpython ipython } teach you very easily
93.
Python can communicate With Other Languages
94.
C + Python
95.
96.
Java + Python
97.
98.
GUI With Python
99.
100.
Glade + Python + GTK = GUI APP
101.
GLADE
102.
Using Glade + Python
103.
Web Web
104.
Web Frame Work in Python
105.
106.
107.
Python / CDAT Tips Blog Links http://pyaos.johnnylin.com/?page_id=10 http://pyaos.johnnylin.com/?page_id=807 http://www.johnnylin.com/cdat_tips/ http://pyaos.johnnylin.com/
Descargar ahora