SlideShare una empresa de Scribd logo
1 de 25
Sujit Shakya
Python
Programming Language?
Language is a tool to perform certain task.
Categories:
Compiled language & Interpreted/Scripting
Language
C, C++ are the example of Compiled Language.
PHP, Perl are the example of Scripting Language
What is Python?
Compiled Language or Scripting Language?
What is Python?
Compiled Language or Scripting Language?
Python was developed by Guido van Rossum in the
late 1980s.
It is an Object Oriented High Level Language.
Python is a scripting language, but in principle, it is first compiled and
then interpreted.
Guido Van Rossum
Why Python?
print “hello” #display hello in the screen
include<stdio.h>
include<conio.h>
void main()
{
printf(“Hello World”); /*display hello in the screen*/
getch();
}
Python focuses on user readability and
simplicity
pi = 3.14
for r in range(4):
area = pi * r*r
print r, area
print “End of Program”
Python is dynamic in nature.
#include<stdio.h>
#include<conio.h>
void main(){
float pi = 3.14;
int r;
float area = 0;
for(r=0; r<5; r++){
area = pi * r*r;
printf(“%d %f”, r, area);
}
printf(“End of Program”);
}
Why Python?
Why Python?
 Beautiful is better than ugly.
 Explicit is better than implicit.
 Simple is better than complex.
 Complex is better than complicated.
 Readability counts.
Lots of documentation and resources are
available in internet for FREE !!
Why not Python?
 Its dynamic nature costs more memory usage.
 Its execution is slower than other compiled language
like C and java.
Who uses Python?
Who uses Python?
Who uses Python?
Who uses Python?
How to use Python?
Installation
Download python 2.7 interpreter from http://www.python.org/download/
and install it.
How to use Python?
Installation
Download python 2.7 interpreter from http://www.python.org/download/
and install it.
Getting Started
Open python shell from start menu.
Open the new window from file menu, write some python code and
press F5.
Or, simply type your python code and press enter.
How to use Python?
Basic Syntax
#print something on screen
print “something”
How to use Python?
Basic Syntax
#print something on screen
print “something”
#if condition
if some_condition_1:
statements 1
elif some_condition_2:
statement 2
else:
statement 3
How to use Python?
Basic Syntax
#for loop
for count in range(10):
do something for 10 times starting from 0-9
How to use Python?
Basic Syntax
#for loop
for count in range(10):
do something for 10 times starting from 0-9
#while loop
i=0
while i<5:
print “hello”, i
i+=1
How to use Python?
Basic Syntax
#list
num_list = [0,1,2,3,4,5]
print num_list[0] #prints 0
print num_list[9] #Error: index out of range
How to use Python?
Basic Syntax
#list
num_list = [0,1,2,3,4,5]
print num_list[0] #prints 0
print num_list[9] #Error: index out of range
#exception handling
try:
print num_list[9]
except:
print “Oops something went wrong”
How to use Python?
Basic Syntax
#function
def sample_function:
„‟‟some code written here. Where triple quote is a
multiple line comment and also a documentation for
your function‟‟‟
GUI application using Python.
Python has a huge number of GUI framework (or
toolkit).
Some of them are:1. Tkinter
2. PyQt
3. PyGTK
4. PyUI
and many more…………
Web Application using
Python.
Python has a huge number of web framework.
Some of them are:
1. Django Web Framework
2. Cherry Py
3. Web2py
4. Zope2
and many more…………
Thank You!!!!

Más contenido relacionado

La actualidad más candente

Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonPro Guide
 
1.python interpreter and interactive mode
1.python interpreter and interactive mode1.python interpreter and interactive mode
1.python interpreter and interactive modeManjuA8
 
The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184Mahmoud Samir Fayed
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonGLC Networks
 

La actualidad más candente (6)

Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of Python
 
1.python interpreter and interactive mode
1.python interpreter and interactive mode1.python interpreter and interactive mode
1.python interpreter and interactive mode
 
The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184The Ring programming language version 1.5.3 book - Part 16 of 184
The Ring programming language version 1.5.3 book - Part 16 of 184
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Expo java
Expo javaExpo java
Expo java
 
Basics of python
Basics of pythonBasics of python
Basics of python
 

Destacado

Samarjit Kachari-New media:Hope for literature and language survival?
Samarjit Kachari-New media:Hope for literature and language survival?Samarjit Kachari-New media:Hope for literature and language survival?
Samarjit Kachari-New media:Hope for literature and language survival?pumediaseminar2011
 
Health 2.0 pre ga slides day 1 & change management
Health 2.0 pre ga slides day 1 & change managementHealth 2.0 pre ga slides day 1 & change management
Health 2.0 pre ga slides day 1 & change managementSalmaan Sana
 
Intro to Python Workshop San Diego, CA (January 19, 2013)
Intro to Python Workshop San Diego, CA (January 19, 2013)Intro to Python Workshop San Diego, CA (January 19, 2013)
Intro to Python Workshop San Diego, CA (January 19, 2013)Kendall
 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaActiveState
 
Why Python is better for Data Science
Why Python is better for Data ScienceWhy Python is better for Data Science
Why Python is better for Data ScienceÍcaro Medeiros
 
Hadoop with Python
Hadoop with PythonHadoop with Python
Hadoop with PythonDonald Miner
 

Destacado (10)

Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Samarjit Kachari-New media:Hope for literature and language survival?
Samarjit Kachari-New media:Hope for literature and language survival?Samarjit Kachari-New media:Hope for literature and language survival?
Samarjit Kachari-New media:Hope for literature and language survival?
 
Health 2.0 pre ga slides day 1 & change management
Health 2.0 pre ga slides day 1 & change managementHealth 2.0 pre ga slides day 1 & change management
Health 2.0 pre ga slides day 1 & change management
 
Welcome to Python
Welcome to PythonWelcome to Python
Welcome to Python
 
Intro to Python Workshop San Diego, CA (January 19, 2013)
Intro to Python Workshop San Diego, CA (January 19, 2013)Intro to Python Workshop San Diego, CA (January 19, 2013)
Intro to Python Workshop San Diego, CA (January 19, 2013)
 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua Franca
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Python
Python Python
Python
 
Why Python is better for Data Science
Why Python is better for Data ScienceWhy Python is better for Data Science
Why Python is better for Data Science
 
Hadoop with Python
Hadoop with PythonHadoop with Python
Hadoop with Python
 

Similar a Ctrc python

Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programmingkanteshraj
 
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON Nandakumar P
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptxMaheShiva
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxManohar k
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of pythonBijuAugustian
 
Python Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computerPython Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computersharanyarashmir5
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming LanguageR.h. Himel
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonRanjith kumar
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Languageanaveenkumar4
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdfANIKULSAIKH
 
637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptx637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptxArjun123Bagri
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notesBhavsingh Maloth
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHBhavsingh Maloth
 

Similar a Ctrc python (20)

Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
 
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Govind.ppt.pptx
Govind.ppt.pptxGovind.ppt.pptx
Govind.ppt.pptx
 
Lecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python LanguageLecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python Language
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
Python Tutorials.pptx
Python Tutorials.pptxPython Tutorials.pptx
Python Tutorials.pptx
 
Python Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computerPython Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computer
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python PPT1.pdf
Python PPT1.pdfPython PPT1.pdf
Python PPT1.pdf
 
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
intro.pptx (1).pdf
intro.pptx (1).pdfintro.pptx (1).pdf
intro.pptx (1).pdf
 
637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptx637b4894085c4_ppt.pptx
637b4894085c4_ppt.pptx
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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 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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
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, AdobeApidays 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, Adobeapidays
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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 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, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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, AdobeApidays 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
 

Ctrc python

  • 2. Programming Language? Language is a tool to perform certain task. Categories: Compiled language & Interpreted/Scripting Language C, C++ are the example of Compiled Language. PHP, Perl are the example of Scripting Language
  • 3. What is Python? Compiled Language or Scripting Language?
  • 4. What is Python? Compiled Language or Scripting Language? Python was developed by Guido van Rossum in the late 1980s. It is an Object Oriented High Level Language. Python is a scripting language, but in principle, it is first compiled and then interpreted.
  • 6. Why Python? print “hello” #display hello in the screen include<stdio.h> include<conio.h> void main() { printf(“Hello World”); /*display hello in the screen*/ getch(); } Python focuses on user readability and simplicity
  • 7. pi = 3.14 for r in range(4): area = pi * r*r print r, area print “End of Program” Python is dynamic in nature. #include<stdio.h> #include<conio.h> void main(){ float pi = 3.14; int r; float area = 0; for(r=0; r<5; r++){ area = pi * r*r; printf(“%d %f”, r, area); } printf(“End of Program”); } Why Python?
  • 8. Why Python?  Beautiful is better than ugly.  Explicit is better than implicit.  Simple is better than complex.  Complex is better than complicated.  Readability counts. Lots of documentation and resources are available in internet for FREE !!
  • 9. Why not Python?  Its dynamic nature costs more memory usage.  Its execution is slower than other compiled language like C and java.
  • 14. How to use Python? Installation Download python 2.7 interpreter from http://www.python.org/download/ and install it.
  • 15. How to use Python? Installation Download python 2.7 interpreter from http://www.python.org/download/ and install it. Getting Started Open python shell from start menu. Open the new window from file menu, write some python code and press F5. Or, simply type your python code and press enter.
  • 16. How to use Python? Basic Syntax #print something on screen print “something”
  • 17. How to use Python? Basic Syntax #print something on screen print “something” #if condition if some_condition_1: statements 1 elif some_condition_2: statement 2 else: statement 3
  • 18. How to use Python? Basic Syntax #for loop for count in range(10): do something for 10 times starting from 0-9
  • 19. How to use Python? Basic Syntax #for loop for count in range(10): do something for 10 times starting from 0-9 #while loop i=0 while i<5: print “hello”, i i+=1
  • 20. How to use Python? Basic Syntax #list num_list = [0,1,2,3,4,5] print num_list[0] #prints 0 print num_list[9] #Error: index out of range
  • 21. How to use Python? Basic Syntax #list num_list = [0,1,2,3,4,5] print num_list[0] #prints 0 print num_list[9] #Error: index out of range #exception handling try: print num_list[9] except: print “Oops something went wrong”
  • 22. How to use Python? Basic Syntax #function def sample_function: „‟‟some code written here. Where triple quote is a multiple line comment and also a documentation for your function‟‟‟
  • 23. GUI application using Python. Python has a huge number of GUI framework (or toolkit). Some of them are:1. Tkinter 2. PyQt 3. PyGTK 4. PyUI and many more…………
  • 24. Web Application using Python. Python has a huge number of web framework. Some of them are: 1. Django Web Framework 2. Cherry Py 3. Web2py 4. Zope2 and many more…………