Enviar pesquisa
Carregar
Python an-intro-python-month-2013
•
30 gostaram
•
5,639 visualizações
Arulalan T
Seguir
Tecnologia
Educação
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 117
Baixar agora
Baixar para ler offline
Recomendados
Python an-intro-python-month-2013
Python an-intro-python-month-2013
Konark modi
Python an-intro v2
Python an-intro v2
Arulalan T
Python an-intro youtube-livestream-day1
Python an-intro youtube-livestream-day1
MAHALAKSHMI P
65 - An Empirical Simulation-based Study of Real-Time Speech Translation for ...
65 - An Empirical Simulation-based Study of Real-Time Speech Translation for ...
ESEM 2014
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
Python presentation
Python presentation
gaganapponix
Presentation on java
Presentation on java
william john
Introduction to Python
Introduction to Python
MuhammadBakri13
Recomendados
Python an-intro-python-month-2013
Python an-intro-python-month-2013
Konark modi
Python an-intro v2
Python an-intro v2
Arulalan T
Python an-intro youtube-livestream-day1
Python an-intro youtube-livestream-day1
MAHALAKSHMI P
65 - An Empirical Simulation-based Study of Real-Time Speech Translation for ...
65 - An Empirical Simulation-based Study of Real-Time Speech Translation for ...
ESEM 2014
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
Python presentation
Python presentation
gaganapponix
Presentation on java
Presentation on java
william john
Introduction to Python
Introduction to Python
MuhammadBakri13
Everyday Python Idioms
Everyday Python Idioms
Fauzan Erich Emmerling
Introduction to Python
Introduction to Python
DrMohammed Qassim
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
IRJET Journal
Presentation on python
Presentation on python
william john
Introduction to python
Introduction to python
Jaya Kumari
Description about python
Description about python
Techdata Solutions
Machine learning session 1
Machine learning session 1
NirsandhG
Python Programming Course
Python Programming Course
iseestech
Python
Python
Mohammad Junaid Khan
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202
Mahmoud Samir Fayed
Python programming
Python programming
Megha V
The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
Mahmoud Samir Fayed
Top python interview question and answer
Top python interview question and answer
Ankita Singh
The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.5.1 book - Part 173 of 180
Mahmoud Samir Fayed
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
Mahmoud Samir Fayed
Introduction to python
Introduction to python
Ranjith kumar
Types Of Coding Languages: A Complete Guide To Master Programming
Types Of Coding Languages: A Complete Guide To Master Programming
calltutors
Python Programming
Python Programming
shahid sultan
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
Mahmoud Samir Fayed
Programing paradigm & implementation
Programing paradigm & implementation
Bilal Maqbool ツ
Wireless Networking
Wireless Networking
ruledbyrobotics2080
Hot Technology Topics in 2017
Hot Technology Topics in 2017
inside-BigData.com
Mais conteúdo relacionado
Mais procurados
Everyday Python Idioms
Everyday Python Idioms
Fauzan Erich Emmerling
Introduction to Python
Introduction to Python
DrMohammed Qassim
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
IRJET Journal
Presentation on python
Presentation on python
william john
Introduction to python
Introduction to python
Jaya Kumari
Description about python
Description about python
Techdata Solutions
Machine learning session 1
Machine learning session 1
NirsandhG
Python Programming Course
Python Programming Course
iseestech
Python
Python
Mohammad Junaid Khan
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202
Mahmoud Samir Fayed
Python programming
Python programming
Megha V
The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
Mahmoud Samir Fayed
Top python interview question and answer
Top python interview question and answer
Ankita Singh
The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.5.1 book - Part 173 of 180
Mahmoud Samir Fayed
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
Mahmoud Samir Fayed
Introduction to python
Introduction to python
Ranjith kumar
Types Of Coding Languages: A Complete Guide To Master Programming
Types Of Coding Languages: A Complete Guide To Master Programming
calltutors
Python Programming
Python Programming
shahid sultan
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
Mahmoud Samir Fayed
Programing paradigm & implementation
Programing paradigm & implementation
Bilal Maqbool ツ
Mais procurados
(20)
Everyday Python Idioms
Everyday Python Idioms
Introduction to Python
Introduction to Python
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
Presentation on python
Presentation on python
Introduction to python
Introduction to python
Description about python
Description about python
Machine learning session 1
Machine learning session 1
Python Programming Course
Python Programming Course
Python
Python
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202
Python programming
Python programming
The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
Top python interview question and answer
Top python interview question and answer
The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
Introduction to python
Introduction to python
Types Of Coding Languages: A Complete Guide To Master Programming
Types Of Coding Languages: A Complete Guide To Master Programming
Python Programming
Python Programming
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
Programing paradigm & implementation
Programing paradigm & implementation
Destaque
Wireless Networking
Wireless Networking
ruledbyrobotics2080
Hot Technology Topics in 2017
Hot Technology Topics in 2017
inside-BigData.com
Wireless network ppt
Wireless network ppt
Basil John
Emerging trends in it technology
Emerging trends in it technology
Chetan Sagar
Wireless Network Presentation
Wireless Network Presentation
mrtheodisthorne2
Ip address
Ip address
Amandeep Kaur
Wireless networking
Wireless networking
Online
Securing the Cloud
Securing the Cloud
GGV Capital
Report on cloud computing by prashant gupta
Report on cloud computing by prashant gupta
Prashant Gupta
Cloud Computing Documentation Report
Cloud Computing Documentation Report
Usman Sait
Introduction to Development for the Internet
Introduction to Development for the Internet
Mike Crabb
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-Presented
SlideShare
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
Destaque
(13)
Wireless Networking
Wireless Networking
Hot Technology Topics in 2017
Hot Technology Topics in 2017
Wireless network ppt
Wireless network ppt
Emerging trends in it technology
Emerging trends in it technology
Wireless Network Presentation
Wireless Network Presentation
Ip address
Ip address
Wireless networking
Wireless networking
Securing the Cloud
Securing the Cloud
Report on cloud computing by prashant gupta
Report on cloud computing by prashant gupta
Cloud Computing Documentation Report
Cloud Computing Documentation Report
Introduction to Development for the Internet
Introduction to Development for the Internet
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-Presented
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Semelhante a Python an-intro-python-month-2013
INTRODUCTION TO PYTHON PROGRAMMING .pptx
INTRODUCTION TO PYTHON PROGRAMMING .pptx
SanthoshRajan16
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
Intro to Python
Intro to Python
primeteacher32
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
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
Manohar k
INTRODUCTION-TO-PYTHON
INTRODUCTION-TO-PYTHON
RuchiNagar3
Semelhante a Python an-intro-python-month-2013
(20)
INTRODUCTION TO PYTHON PROGRAMMING .pptx
INTRODUCTION TO PYTHON PROGRAMMING .pptx
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
Intro to Python
Intro to Python
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
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
INTRODUCTION-TO-PYTHON
INTRODUCTION-TO-PYTHON
Mais 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
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
Automatic B Day Remainder Program
Automatic B Day Remainder Program
Arulalan T
Mais 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
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
Automatic B Day Remainder Program
Automatic B Day Remainder Program
Último
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
The Digital Insurer
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
SynarionITSolutions
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
Último
(20)
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Python an-intro-python-month-2013
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.
Database Intergration
90.
import psycopg2 conn = psycopg2.connect(" dbname='pg_database' user='dbuser' host='localhost' password='dbpass' ") cur = conn.cursor() cur.execute("""SELECT * from pg_table""") rows = cur.fetchall() print rows cur.close() conn.close()
91.
import psycopg2 conn = psycopg2.connect(" dbname='pg_database' user='dbuser' host='localhost' password='dbpass' ") cur = conn.cursor() cur.execute("'insert into pg_table values(1,'python')"') conn.commit() cur.close() conn.close()
92.
THE END of code :)
93.
How to learn ?
94.
Python – Shell ● Interactive Python ● Instance Responce ●
Learn as you type
95.
bpython ipython } teach you very easily
96.
http://www.pythontutor.com Online Python Editor & Execution Visualizer
97.
Python can communicate With Other Languages
98.
C + Python
99.
100.
Java + Python
101.
102.
GUI With Python
103.
104.
Glade + Python + GTK = GUI APP
105.
GLADE
106.
Using Glade + Python
107.
Web Web
108.
Web Frame Work in Python
109.
110.
import pygame p = pygame.init( ) # p object has so many methods to create your own pygame
111.
Why are you still playing video games, when you can create your own ! Why not 3D games !
112.
MatPlotLib – 2D/3D Scientific Visualization Library
113.
114.
Who are all using Python ? and many more ...
Baixar agora