SlideShare una empresa de Scribd logo
1 de 22
Introduction to Python
Why do people use Python?
• Software Quality:
Python is designed to be readable, and hence maintainable.
• Developer productivity:
Python code is typically 1/3 to 1/5 the size of equivalent C++ or JAVA
code
What can I do with Python?
• System Programming
• GUIs
• Internet Scripting
• Database Programming
• Games, Images, AI, XML and more
What are Python’s Technical Strength
• It’s OO
• It’s free
• It’s Portable
• It’s Powerful
• It’s Easy to use
• It’s Easy to learn
What is the Downside of Python?
• Perhaps the only downside to Python is that the execution speed
may not always as fast as compiled languages such as C and C++
• Python is not compiled all the way down to binary machine code, it
compiled to byte code instead.
Who Uses Python Today?
• Google and Yahoo currently use Python in Internet service
• IBM use Python for hardware testing
• Industrial Light and Magic use Python in the production of movie
animation
• For more details, visit www.python.org
Install Python
• Go to http://www.python.org/download/releases/3.2/ and
download Python3.2, then select Windows x86 MSI Installer
(3.2) or Windows X86-64 MSI Installer (3.2)
Install Python
• Or you can search for Python, choose “Download” and then
select Python 3.2 Windows x86 MSI Installer or Python 3.2
Windows X86-64 MSI Installer
Hello World Program
• Implement by three different languages
• In C
• In JAVA
• In Python
“Hello World” in C
main()
{
printf("hello, worldn");
}
“Hello World” in JAVA
class myfirstjavaprog
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}
“Hello World” in Python
print (“Hello World!!”)
Be familiar with Python
>>> print ("Hello, World! ")
Hello, World!
>>> 10 + 25
35
>>> 124 – 125
-1
>>> 1/3
0.333333333333333
• Python command print – Displays data, values, and expressions
• The single and double quotation mark string objects, which are
collections of texts surrounded by quotes.
Some Python commands
Be familiar with Python
>>> print ("Hello, World! ")
Hello, World!
>>> "hello"
'hello'
>>> "world"
'world'
>>> "hello"+"world"
'helloworld'
Be familiar with Python
>>> "hello" * 3
'hellohellohello'
>>> "hello" * 300
>>> width = 20
>>> height = 45
>>> area = width * height
>>> area
900
Declare a variable and assign its
value Example: Area of a
rectangle
>>> a=3
>>> b=4
>>> a+1
>>> b*3
>>> b/3
>>> b/3.0
>>> b**2
>>> 2+4.0
>>> 2.0**b
What are the outputs? Why?
How do you run programs?
Three different methods:
• 1. Interactive Coding
• 2. Files (such as NotePad, WordPad)
• 3. Integrated Development Environment (IDE)
Create and run a program in the
Python IDLE
• From File -> New Window
• Type your program
print ("Hello, World! ")
• Save your program
(Give a name you like, such as test.py)
• Run the program
(by selecting the Run Module or pressing the F5 key)
Your first Python program- hello.py
# This program says hello and asks for my name.
hello = 'Hello world! '
print(hello)
print('What is your name?')
myName = input()
print('It is good to meet you, ' + myName)
hello.py executed sequentially
# This program says hello and asks for my name.
Any text following a # sign is a comment. Comments are not
for the computer, but for you, the programmer.
1.hello = 'Hello world! ' # assign the string to a name
2.print(hello) # call the print( ) function
3.print('What is your name?') # call the print( ) function
4.myName = input() # call the input( ) function
5.print('It is good to meet you, ' + myName)

Más contenido relacionado

La actualidad más candente

Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming KrishnaMildain
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on pythonwilliam john
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Pedro Rodrigues
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabusSugantha T
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python pptPriyanka Pradhan
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019Samir Mohanty
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of PythonElewayte
 

La actualidad más candente (20)

Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python ppt
Python pptPython ppt
Python ppt
 
Python basic
Python basicPython basic
Python basic
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python ppt
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Python basics
Python basicsPython basics
Python basics
 
Python programming
Python  programmingPython  programming
Python programming
 
Python
PythonPython
Python
 
Python by Rj
Python by RjPython by Rj
Python by Rj
 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 

Destacado

Ambidextrous Python - Introduction Python Libraries
Ambidextrous Python - Introduction Python Libraries Ambidextrous Python - Introduction Python Libraries
Ambidextrous Python - Introduction Python Libraries Anoop Thomas Mathew
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An IntroductionEueung Mulyana
 
Python Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data ScienceArc & Codementor
 
Introduction to Python programming
Introduction to Python programmingIntroduction to Python programming
Introduction to Python programmingDamian T. Gordon
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask TrainingJanBask Training
 

Destacado (8)

Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Ambidextrous Python - Introduction Python Libraries
Ambidextrous Python - Introduction Python Libraries Ambidextrous Python - Introduction Python Libraries
Ambidextrous Python - Introduction Python Libraries
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Python Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to PythonPython Ireland Feb '11 Talks: Introduction to Python
Python Ireland Feb '11 Talks: Introduction to Python
 
Introduction to Python for Data Science
Introduction to Python for Data ScienceIntroduction to Python for Data Science
Introduction to Python for Data Science
 
Introduction to Python programming
Introduction to Python programmingIntroduction to Python programming
Introduction to Python programming
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
 

Similar a Introduction to python

python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdfgmadhu8
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPTShivam Gupta
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptxGnanesh12
 
Why python introduction
Why python introductionWhy python introduction
Why python introductionIvan Chiou
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1Kirti Verma
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptxMohammedAlYemeni1
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Itzik Kotler
 
PYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptxPYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptxswarna627082
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲Mohammad Reza Kamalifard
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningArthur Emanuel
 

Similar a Introduction to python (20)

python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Python
PythonPython
Python
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
 
Why python introduction
Why python introductionWhy python introduction
Why python introduction
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
python into.pptx
python into.pptxpython into.pptx
python into.pptx
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptx
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
PYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptxPYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptx
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
 
Chapter-6.pdf
Chapter-6.pdfChapter-6.pdf
Chapter-6.pdf
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
 

Más de Syed Zaid Irshad

Más de Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
C Language
C LanguageC Language
C Language
 
Flowchart
FlowchartFlowchart
Flowchart
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 

Último

TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxachiever3003
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxCooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxmamansuratman0253
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Último (20)

Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptx
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxCooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

Introduction to python

  • 2. Why do people use Python? • Software Quality: Python is designed to be readable, and hence maintainable. • Developer productivity: Python code is typically 1/3 to 1/5 the size of equivalent C++ or JAVA code
  • 3. What can I do with Python? • System Programming • GUIs • Internet Scripting • Database Programming • Games, Images, AI, XML and more
  • 4. What are Python’s Technical Strength • It’s OO • It’s free • It’s Portable • It’s Powerful • It’s Easy to use • It’s Easy to learn
  • 5. What is the Downside of Python? • Perhaps the only downside to Python is that the execution speed may not always as fast as compiled languages such as C and C++ • Python is not compiled all the way down to binary machine code, it compiled to byte code instead.
  • 6. Who Uses Python Today? • Google and Yahoo currently use Python in Internet service • IBM use Python for hardware testing • Industrial Light and Magic use Python in the production of movie animation • For more details, visit www.python.org
  • 7. Install Python • Go to http://www.python.org/download/releases/3.2/ and download Python3.2, then select Windows x86 MSI Installer (3.2) or Windows X86-64 MSI Installer (3.2)
  • 8. Install Python • Or you can search for Python, choose “Download” and then select Python 3.2 Windows x86 MSI Installer or Python 3.2 Windows X86-64 MSI Installer
  • 9. Hello World Program • Implement by three different languages • In C • In JAVA • In Python
  • 10. “Hello World” in C main() { printf("hello, worldn"); }
  • 11. “Hello World” in JAVA class myfirstjavaprog { public static void main(String args[]) { System.out.println("Hello World!"); } }
  • 12. “Hello World” in Python print (“Hello World!!”)
  • 13. Be familiar with Python >>> print ("Hello, World! ") Hello, World! >>> 10 + 25 35 >>> 124 – 125 -1 >>> 1/3 0.333333333333333
  • 14. • Python command print – Displays data, values, and expressions • The single and double quotation mark string objects, which are collections of texts surrounded by quotes. Some Python commands
  • 15. Be familiar with Python >>> print ("Hello, World! ") Hello, World! >>> "hello" 'hello' >>> "world" 'world' >>> "hello"+"world" 'helloworld'
  • 16. Be familiar with Python >>> "hello" * 3 'hellohellohello' >>> "hello" * 300
  • 17. >>> width = 20 >>> height = 45 >>> area = width * height >>> area 900 Declare a variable and assign its value Example: Area of a rectangle
  • 18. >>> a=3 >>> b=4 >>> a+1 >>> b*3 >>> b/3 >>> b/3.0 >>> b**2 >>> 2+4.0 >>> 2.0**b What are the outputs? Why?
  • 19. How do you run programs? Three different methods: • 1. Interactive Coding • 2. Files (such as NotePad, WordPad) • 3. Integrated Development Environment (IDE)
  • 20. Create and run a program in the Python IDLE • From File -> New Window • Type your program print ("Hello, World! ") • Save your program (Give a name you like, such as test.py) • Run the program (by selecting the Run Module or pressing the F5 key)
  • 21. Your first Python program- hello.py # This program says hello and asks for my name. hello = 'Hello world! ' print(hello) print('What is your name?') myName = input() print('It is good to meet you, ' + myName)
  • 22. hello.py executed sequentially # This program says hello and asks for my name. Any text following a # sign is a comment. Comments are not for the computer, but for you, the programmer. 1.hello = 'Hello world! ' # assign the string to a name 2.print(hello) # call the print( ) function 3.print('What is your name?') # call the print( ) function 4.myName = input() # call the input( ) function 5.print('It is good to meet you, ' + myName)