Let Us Python (Second Edition)
eBook - ePub

Let Us Python (Second Edition)

Python Is Future, Embrace It Fast

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Let Us Python (Second Edition)

Python Is Future, Embrace It Fast

About this book

Learn Python Quickly, A Programmer-Friendly Guide.Most Programmer's learning Python are usually comfortable with some or the other programming language and are not interested in going through the typical learning curve of learning the first programming language. Instead, they are looking for something that can get them off the ground quickly. They are looking for similarities and differences in a feature that they have used in other language(s). This book should help them immediately. It guides you from the fundamentals of using module through the use of advanced object orientation.Key FeaturesStrengthens the foundations, as detailed explanation of programming language concepts are given in simple manner.Lists down all the important points that you need to know related to various topics in an organized manner.Prepares you for coding related interview and theoretical questions.Provides In depth explanation of complex topics and Questions.Focuses on how to think logically to solve a problem.Follows a systematic approach that will help you to prepare for an interview in short duration of time.Exercises are exceptionally useful to complete the reader's understanding of a topic.What will you learnData types, Control flow instructions, console & File Input/OutputStrings, list & tuples, List comprehensionSets & Dictionaries, Functions & LambdasDictionary ComprehensionModules, classes and objects, InheritanceOperator overloading, Exception handlingIterators & Generators, Decorators, Command-line ParsingWho this book is forStudents, Programmers, researchers, and software developers who wish to learn the basics of Python programming language.About the AuthorsYashavant Kanetkar Through his books and Quest Video Courses on C, C++, Java, Python, Data Structures,.NET, IoT, etc. Yashavant Kanetkar has created, moulded and groomed lacs of IT careers in the last three decades. Yashavant's books and Quest videos have made a significant contribution in creating top-notch IT manpower in India and abroad.Yashavant's books are globally recognized and millions of students/professionals have benefitted from them. Yashavant's books have been translated into Hindi, Gujarati, Japanese, Korean and Chinese languages. Many of his books are published in India, USA, Japan, Singapore, Korea and China.His Linkedin profile: linkedin.com/in/yashavant-kanetkar-9775255Aditya Kanetkar is currently working as a backend Software Engineer at Microsoft, Redmond, USA. He has been designing distributed systems software for the last 4 years. He has worked at multiple companies in the past, including Oracle, Redfin, Amazon and Arista Networks.Aditya holds a Master's Degree in Computer Science from Georgia Tech, Atlanta and a Bachelor's Degree in Computer Science and Engineering from IIT Guwahati.His Linkedin Profile: linkedin.com/in/aditya-kanetkar-a4292397

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Let Us Python (Second Edition) by Yashavant Kanetkar,Aditya Kanetkar in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

1

Introduction to Python

  • What is Python?
  • Reasons for Popularity
  • What sets Python apart?
  • What can be done using Python?
  • Who uses Python today?
  • Python Resources
  • Programming Paradigms
  • Functional Programming Model
  • Procedural Programming Model
  • Object-oriented Programming Model
  • Event-driven Programming Model
  • Exercise

KanNotes

What is Python?

  • Python is a high-level programming language created by Guido Van Rossum - fondly known as Benevolent Dictator For Life.
  • Python was first released in 1991. Today Python interpreters are available for many Operating Systems including Windows and Linux.
  • Python programmers are often called Pythonists or Pythonistas.

Reasons for Popularity

  • There are several reasons for Python's popularity. These include:
    1. Free:
      - Python is free to use and distribute and is supported by community.
      - Python interpreter is available for every major platform.
    2. Software quality:
      - Better than traditional and scripting languages.
      - Readable code, hence reusable and maintainable.
      - Support for advance reuse mechanisms.
    3. Developer productivity:
      - Much better than statically typed languages.
      - Much smaller code.
      - Less to type, debug and maintain.
      - No lengthy compile and link steps.
    4. Program portability:
      - Python programs run unchanged on most platforms.
      - Python runs on every major platform currently in use.
      - Porting program to a new platform usually need only cut and paste. This is true even for GUI, DB access, Web programming, OS interfacing, Directory access, etc.
    5. Support libraries:
      - Strong library support from Text pattern matching to networking.
      - Vast collection of third party libraries.
      - Libraries for Web site construction, Numeric programming, Game development, Machine Learning etc.
    6. Component integration:
      - Can invoke C, C++ libraries and Java components.
      - Can communicate with frameworks such as COM, .NET.
      - Can interact over networks with interfaces like SOAP, XML-RPC, CORBA.
      - With appropriate glue code, Python can subclass C++, Java, C#. classes, thereby extending the reach of the program.
      - Popularly used for product customization and extension.
    7. Enjoyment:
      - Ease of use.
      - Built-in toolset.
      - Programming becomes pleasure than work.

What sets Python apart?

  1. Powerful:
    - Dynamic typing
    - No variable declaration
    - Automatic allocation and Garbage Collection
    - Supports classes, modules and exceptions
    - Permits componentization and reuse
    - Powerful containers - Lists, Dictionaries, Tuples, etc.
  2. Ready-made stuff:
    - Support for operations like joining, slicing, sorting, mapping, etc.
    - Powerful library
    - Large collection of third-party utilities
  3. Ease of use:
    - Type and run
    - No compile and link steps
    - Interactive programming experience
    - Rapid turnaround
    - Programs are simpler, smaller and more flexible

What can be done using Python?

  • Python is used for multiple purposes. These include:
    1. System programming
    2. Building GUI applications
    3. Internet scripting
    4. Component integration
    5. Database programming
    6. Rapid prototyping
    7. Numeric and Scientific programming
    8. Game programming
    9. Robotics programming

Who uses Python today?

  • Many organizations use Python for varied purposes. These include:
    1. Google - In web search system
    2. YouTube - Video Sharing service
    3. Bit-torrent - Peer to Peer file sharing system
    4. Intel, HP, Seagate, IBM, Qualcomm - Hardware testing
    5. Pixar, Industrial Light and Magic - Movie animation
    6. JP Morgan, Chase, UBS - Financial market forecasting
    7. NASA, FermiLab - Scientific programming
    8. iRobot - Commercial robot vacuum cleaners
    9. NSA - Cryptographic and Intelligence analysis
    10. IronPort - Email Servers

Python Resources

  • Python source code, binaries and documentation is available at:
    - Python official website: www.python.org
    - Documentation website: www.python.org/doc
  • Once Python is installed, program development can be done using the built-in Python Integrated Development and Learning Environment (IDLE) or third-party IDEs.
  • Third-party development tools include:
    - NetBeans IDE for Python:
    https://download.netbeans.org/netbeans/6.5/python/ea/
    - PyCharm IDE for Python:
    https://www.jetbrains.com/pycharm
    - Visual Studio Code IDE:
    https://code.visualstudio.com/download
  • If you do not wish to install any Python development tool on your machine, then you can use any of the following online Python shells:
    - https://www.python.org/shell/
    - https://ideone.com/
    - https://repl.it/languages/python3

Programming Paradigms

  • Paradigm means organization principle. It is also known as model.
  • Programming paradigm /model is a style of building the structure and elements of computer programs.
  • There exist many programming models like Functional, Procedural, Object-oriented, Event-driven, etc.
  • Many languages facilitate programming in one or more paradigms. For example, Python supports Functional, Procedural, Object-oriented and Event-driven programming models.
  • There are situations when Functional programming is the obvious choice, and other situations were Procedural programming is the better choice.
  • Paradigms are not meant to be mutually exclusive. A single program may use multiple paradigms.

Functional Programming Model

  • Functional programming decomposes a problem into a set of functions. These functions provide the main source of logic in the program.
  • Functions take input parameters and produce outputs. Python provides functional programming techniques like lambda, map, reduce and filter. These are discussed in Chapter 14.
  • In this model computation is treated as evaluation of mathematical functions. For example, to get factorial value of a number, or nth Fibonacci number we can use the following functions:
  • The output value of a function depends only on its arguments, so calling a function with the same value for an argument always produces the same result. As a result, it is a good fit for parallel execution
  • No function can have side effects on other variables (state remains unaltered).
  • Functional programming model is often called a ‘D eclarative’...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. About the Author
  6. Preface To Second Edition
  7. Brief Contents
  8. Table of Contents
  9. 1 Introduction to Python
  10. 2 Python Basics
  11. 3 Strings
  12. 4 Decision Control Instruction
  13. 5 Repetition Control Instruction
  14. 6 Console Input/Output
  15. 7 Lists
  16. 8 Tuples
  17. 9 Sets
  18. 10 Dictionaries
  19. 11 Comprehensions
  20. 12 Functions
  21. 13 Recursion
  22. 14 Functional Programming
  23. 15 Modules and Packages
  24. 16 Namespaces
  25. 17 Classes and Objects
  26. 18 Intricacies of Classes and Objects
  27. 19 Containership and Inheritance
  28. 20 Iterators and Generators
  29. 21 Exception Handling
  30. 22 File Input/Output
  31. 23 Miscellany
  32. 24 Multi-threading
  33. 25 Synchronization
  34. Index