SlideShare a Scribd company logo
Python Programming For Beginners
Python Programming For
Beginners
Quick And Easy Guide For Python
Programmers
By:
James P. Long
1
James P. Long
Acknowledgments
For my students and friends, who all selflessly helped me in writing this book. Special
thanks to those who asked, insisted and assisted me in turning the seminars in this
practical form. All Rights Reserved 2012-2014 @ James P. Long
Python Programming For Beginners
Table of Contents
Introduction
•What is Python Programming?
•History
Why is Python Used?
Features Of Python
Installing Python To System
Writing Programs in Python
•Interactive Mode Programming
•Script Mode Programming
Basics Of Python
•Python Identifiers
•Lines and Indentation
•Comments
3
James P. Long
•Literal Constants
•Multi-Line Statements
•Quotation in Python
•Command Line Arguments
•Objects & Classes
•Variable Types
Python Data Types
•Boolean values
•Numbers
•Strings
•Tuples
•Lists
•Sets
•Dictionaries
•Sequence
•Reference
Python Operators
Control Flows in Python
•If Statement
•For Statement
•While Statement
•Break Statement
•Continue Statement
Python Programming For Beginners
•Pass Statement
Python Date & Time
Python Functions
•Calling a Function
•Pass by Reference in Function
•The Return Statement
•Python Lambda Function
•Python Arguments And Parameters
•Python Parameters
Global And Local variables in Python
•Local Variables
•Global Variables
Modules in Python
• The import Statement
• The from...import Statement
• The from...import * Statement
• Module Names
• Locating modules
• Executing modules
• Making Your Own Modules
• The dir() function
Packages in Python
Python Exceptions Handling
5
James P. Long
•Hierarchy of Exceptions
•User defined exceptions
•The cleanup
Some Other Functions To Perform In Python
•Reading Keyboard Input
•Opening and Closing Files
•The file object attributes
•Reading and Writing Files
•Renaming and Deleting Files
•Directories in Python
Note
Introduction
What is Python Programming?
Python is a wide used general, high-level programming language. Its style philosophy
emphasizes code readability, and its syntax allows programmers to precise ideas in fewer
lines of code that might be possible in languages like C++ or Java. The language provides
constructs supposed to modify clear programs on both small and large scales.
Python is a simple to learn, powerful programming language. It’s economical high-level
information structures and an easy but effective approach to object-oriented programming.
Python’s elegant syntax and dynamic typing, in conjunction with its interpreted nature,
make it a perfect language for scripting and speedy application development in several
areas on most platforms. Python is one in all those rare languages which might claim to
both easy and powerful. You may end up pleasantly stunned to examine how easy it's to
Python Programming For Beginners
think about the answer to the matter instead of the syntax and structure of the language
you are programming in.
Python supports multiple programming paradigms, as well as object-oriented, imperative
and useful programming or procedural designs. It features a dynamic type system and
automatic memory management and contains a giant and a comprehensive customary
library.
Python interpreters are available for installation on several operational systems, allowing
Python code execution on a majority of systems. Using third-party tools, like Py2exe or
Pyinstaller, Python code will be packaged into complete workable programs for a few of the
most fashionable operational systems, letting the distribution of Python-based software
system to use in those environments without requiring the installation of a Python
interpreter.
Python is a programming language that's freely available. It will be written once and run on
nearly any PC with no need to alter the program. In this book, you can learn a lot about
what Python is, how it's used, and the way it compares to other programming languages.
History
Python was first created by Guido van Rossum in 1990 and was named when the Brit-come
Monty Python's Flying Circus. It’s since been developed by an oversized team of volunteers
and is freely available from the Python software system Foundation.
Python is currently found in several incarnations. At the website of the Python software
system Foundation, Python is written in C, other incarnations also exist. A Java-based
version of Python exists in Jython and should be used to work with Java code natively. Iron
Python, a C# version, exists for the.Net and Mono platforms and allows C# programmers
access to Python's power and flexibility. In each of those instances, Python is written in one
7
James P. Long
language and works natively therewith language; but, it also interacts with other languages
through its several modules.
For functions of analysis and development, there's also a Python implementation written in
Python itself. The project PyPy was based in 2003 to modify Python programmers to alter
the behavior of the Python interpreter at can. Whereas it's an open source project, being
developed overtly by a community of developers for gratis distribution and modification,
PyPy is also supported by the European Union as a Specified Targeted Research Project
(STReP), part of the FP6 funding program.
Summary
Python is so an exciting and powerful language. It’s the proper combination of performance
and features that make writing programs in Python both fun and simple.
For further details about Python Programming you can go through this link:
http://www.amazon.com/dp/B00QR1KFVK/

More Related Content

Viewers also liked

Viewers also liked (7)

Network security and cryptography
Network security and cryptographyNetwork security and cryptography
Network security and cryptography
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2
 
C compilation process
C compilation processC compilation process
C compilation process
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
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
 

More from Kindle Books

Essential oils for beginners
Essential oils for beginnersEssential oils for beginners
Essential oils for beginners
Kindle Books
 
Natural body scrubs at home
Natural body scrubs at homeNatural body scrubs at home
Natural body scrubs at home
Kindle Books
 
Beer brewing at home
Beer brewing at homeBeer brewing at home
Beer brewing at home
Kindle Books
 
Ultimate house cleaning guide
Ultimate house cleaning guideUltimate house cleaning guide
Ultimate house cleaning guide
Kindle Books
 
Complete guide for python programmin1
Complete guide for python programmin1Complete guide for python programmin1
Complete guide for python programmin1
Kindle Books
 
Learn python programming 1
Learn python programming 1Learn python programming 1
Learn python programming 1
Kindle Books
 
Quick and easy guide to learn php with my
Quick and easy guide to learn php with myQuick and easy guide to learn php with my
Quick and easy guide to learn php with my
Kindle Books
 

More from Kindle Books (20)

Beginners guide on php programming
Beginners guide on php programmingBeginners guide on php programming
Beginners guide on php programming
 
Beer Brewing At Home : Easy Ways of Brewing Homemade Beer
Beer Brewing At Home : Easy Ways of Brewing Homemade BeerBeer Brewing At Home : Easy Ways of Brewing Homemade Beer
Beer Brewing At Home : Easy Ways of Brewing Homemade Beer
 
Beer Brewing At Home
Beer Brewing At HomeBeer Brewing At Home
Beer Brewing At Home
 
DIY Ideas At Home
DIY Ideas At HomeDIY Ideas At Home
DIY Ideas At Home
 
Essential oils (sample)
Essential oils (sample)Essential oils (sample)
Essential oils (sample)
 
Beginners Guide on PHP Programming
Beginners Guide on PHP ProgrammingBeginners Guide on PHP Programming
Beginners Guide on PHP Programming
 
Essential oils for beginners
Essential oils for beginnersEssential oils for beginners
Essential oils for beginners
 
Natural body scrubs at home
Natural body scrubs at homeNatural body scrubs at home
Natural body scrubs at home
 
Beer brewing at home
Beer brewing at homeBeer brewing at home
Beer brewing at home
 
Nmap book
Nmap bookNmap book
Nmap book
 
Learn Python Programming
Learn Python ProgrammingLearn Python Programming
Learn Python Programming
 
Ultimate house cleaning guide
Ultimate house cleaning guideUltimate house cleaning guide
Ultimate house cleaning guide
 
Diy ideas at home
Diy ideas at homeDiy ideas at home
Diy ideas at home
 
QUICK GUIDE to VEGAN DIET & LIFESTYLE
QUICK GUIDE to VEGAN DIET & LIFESTYLEQUICK GUIDE to VEGAN DIET & LIFESTYLE
QUICK GUIDE to VEGAN DIET & LIFESTYLE
 
Beer brewing at home
Beer brewing at homeBeer brewing at home
Beer brewing at home
 
Creative confidence
Creative confidenceCreative confidence
Creative confidence
 
Complete guide for python programmin1
Complete guide for python programmin1Complete guide for python programmin1
Complete guide for python programmin1
 
Learn python programming 1
Learn python programming 1Learn python programming 1
Learn python programming 1
 
Diet book
Diet bookDiet book
Diet book
 
Quick and easy guide to learn php with my
Quick and easy guide to learn php with myQuick and easy guide to learn php with my
Quick and easy guide to learn php with my
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
YibeltalNibretu
 

Recently uploaded (20)

GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
 

Python programming for beginners

  • 1. Python Programming For Beginners Python Programming For Beginners Quick And Easy Guide For Python Programmers By: James P. Long 1
  • 2. James P. Long Acknowledgments For my students and friends, who all selflessly helped me in writing this book. Special thanks to those who asked, insisted and assisted me in turning the seminars in this practical form. All Rights Reserved 2012-2014 @ James P. Long
  • 3. Python Programming For Beginners Table of Contents Introduction •What is Python Programming? •History Why is Python Used? Features Of Python Installing Python To System Writing Programs in Python •Interactive Mode Programming •Script Mode Programming Basics Of Python •Python Identifiers •Lines and Indentation •Comments 3
  • 4. James P. Long •Literal Constants •Multi-Line Statements •Quotation in Python •Command Line Arguments •Objects & Classes •Variable Types Python Data Types •Boolean values •Numbers •Strings •Tuples •Lists •Sets •Dictionaries •Sequence •Reference Python Operators Control Flows in Python •If Statement •For Statement •While Statement •Break Statement •Continue Statement
  • 5. Python Programming For Beginners •Pass Statement Python Date & Time Python Functions •Calling a Function •Pass by Reference in Function •The Return Statement •Python Lambda Function •Python Arguments And Parameters •Python Parameters Global And Local variables in Python •Local Variables •Global Variables Modules in Python • The import Statement • The from...import Statement • The from...import * Statement • Module Names • Locating modules • Executing modules • Making Your Own Modules • The dir() function Packages in Python Python Exceptions Handling 5
  • 6. James P. Long •Hierarchy of Exceptions •User defined exceptions •The cleanup Some Other Functions To Perform In Python •Reading Keyboard Input •Opening and Closing Files •The file object attributes •Reading and Writing Files •Renaming and Deleting Files •Directories in Python Note Introduction What is Python Programming? Python is a wide used general, high-level programming language. Its style philosophy emphasizes code readability, and its syntax allows programmers to precise ideas in fewer lines of code that might be possible in languages like C++ or Java. The language provides constructs supposed to modify clear programs on both small and large scales. Python is a simple to learn, powerful programming language. It’s economical high-level information structures and an easy but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, in conjunction with its interpreted nature, make it a perfect language for scripting and speedy application development in several areas on most platforms. Python is one in all those rare languages which might claim to both easy and powerful. You may end up pleasantly stunned to examine how easy it's to
  • 7. Python Programming For Beginners think about the answer to the matter instead of the syntax and structure of the language you are programming in. Python supports multiple programming paradigms, as well as object-oriented, imperative and useful programming or procedural designs. It features a dynamic type system and automatic memory management and contains a giant and a comprehensive customary library. Python interpreters are available for installation on several operational systems, allowing Python code execution on a majority of systems. Using third-party tools, like Py2exe or Pyinstaller, Python code will be packaged into complete workable programs for a few of the most fashionable operational systems, letting the distribution of Python-based software system to use in those environments without requiring the installation of a Python interpreter. Python is a programming language that's freely available. It will be written once and run on nearly any PC with no need to alter the program. In this book, you can learn a lot about what Python is, how it's used, and the way it compares to other programming languages. History Python was first created by Guido van Rossum in 1990 and was named when the Brit-come Monty Python's Flying Circus. It’s since been developed by an oversized team of volunteers and is freely available from the Python software system Foundation. Python is currently found in several incarnations. At the website of the Python software system Foundation, Python is written in C, other incarnations also exist. A Java-based version of Python exists in Jython and should be used to work with Java code natively. Iron Python, a C# version, exists for the.Net and Mono platforms and allows C# programmers access to Python's power and flexibility. In each of those instances, Python is written in one 7
  • 8. James P. Long language and works natively therewith language; but, it also interacts with other languages through its several modules. For functions of analysis and development, there's also a Python implementation written in Python itself. The project PyPy was based in 2003 to modify Python programmers to alter the behavior of the Python interpreter at can. Whereas it's an open source project, being developed overtly by a community of developers for gratis distribution and modification, PyPy is also supported by the European Union as a Specified Targeted Research Project (STReP), part of the FP6 funding program. Summary Python is so an exciting and powerful language. It’s the proper combination of performance and features that make writing programs in Python both fun and simple. For further details about Python Programming you can go through this link: http://www.amazon.com/dp/B00QR1KFVK/