Basic Core Python Programming
eBook - ePub

Basic Core Python Programming

A Complete Reference Book to Master Python with Practical Applications (English Edition)

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

Basic Core Python Programming

A Complete Reference Book to Master Python with Practical Applications (English Edition)

About this book

Learn the most popular software programming language in easy steps

Key Features
? Extensive coverage on fundamentals and core concepts of Python programming.
? A complete reference guide to crack Python Interviews and exams.
? Includes ample MCQs and solved examples to prepare you for theory and practical exams.
? Easy-to-understand text with explanatory illustrations.

Description
Basic Core Python Programming is an absolute beginners book. It focuses on the fundamentals of Python programming and simplifies coding concepts. This book makes it easy to learn the concepts of Python variables, Expressions, Decision structures, and Iteration.Equipped with a lot of exercises and Q&As, you don't just practice the programming but also gain an in-depth understanding of the basic concepts of Python. You will start your journey right from how to go about Python installation and start using its interactive development environment and go on to learn how to build logic and implement it with coding. You will explore different types of data, operators, and in-built functions. This book covers numerous coding examples that will help you understand the importance of each data type, how to work with each one of them, and when to use them. You can learn some more practical useful concepts like how to implement control structures and use them for decision making and controlling the program flow.

What you will learn
? Stronghold on Python variables, expressions, decision structures, and iterations.
? Practical knowledge on how to work with various data types, operators, and in-built functions.
? Learn to implement strings, lists, arrays, and control structures.
? Learn how to control the program flow and how to use it for decision-making.
? A great reference book on Python basics for software programmers.

Who this book is for
This book is highly appealing to all tech-savvy students, programming enthusiasts, IT undergraduates, and computer science students. You do not need any prior knowledge of programming to begin with this book as long as you have the interest to learn to program.

Table of Contents
1. Introduction
2. Python Basics
3. Numbers, Operators, and In-built Functions
4. Strings
5. Lists and Arrays
6. Tuples and Dictionaries
7. Sets and Frozen Sets
8. Program Flow Control in Python

About the Authors
Mrs Meenu Kohli, author of 'Python Interview Questions - Ultimate Guide to Success' has authored another book 'Python Programming for Graduates'. She has written this book for college students with the aim of making the concepts of Python programming easier for them. She holds a degree in BE (Electronics) from D.Y. Patil College of Engineering, Pune University. She has worked as a developer, tester, and trainer with some reputed MNCs and has a lot of experience in software development and testing. She has worked on projects related to Python, Java, EJB, C, C++, PHP, JSP, JavaScript, HTML, .NET, R, MySQL, Oracle, DB2, and Software Testing LinkedIn profile: https://www.linkedin.com/in/meenukohli78/

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.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. 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 Basic Core Python Programming by Meenu Kohli 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.

CHAPTER 1

Introduction

Introduction

You are all set to embark on a journey to learn Python, but before getting started you must learn about different types of programming languages, the history of Python, how it is different from other languages, and so on. This chapter is an introduction to Python Programming.

Structure

  • Overview of programming languages
    • High-level programming languages
    • Low-level programming languages
      • Machine language
      • Assembly language
  • Language processors
    • Assembler
    • Compiler
    • Interpreter
  • Generations of programming languages
  • Programming paradigms
  • History of Python
  • Features of Python
  • Future of Python
  • Installing Python in 5 simple steps
  • Memory management in Python
  • Python versus Java

Objectives

After reading this chapter you will:
  • Understand the difference between low-level and high-level programming languages
  • Know the difference between different types of language processors
  • Learn about generations of programming languages
  • Know about the history of Python
  • Learn about the features of Python
  • Understand the future of Python
  • Learn how to install Python on to your machine
  • Understand Python memory management
  • Understand the difference between Python and Java
Programming languages comprise of a set of rules that direct how commands, symbols, and syntax can be put together to write a piece of code that a computer can execute to carry out a particular task. Programs created using programming languages convey to the computer what needs to be done or what instructions must be carried out to perform a particular task.

1.1 Overview of programming languages

Programming languages are classified into two basic types as shown in figure 1.1:
  • High-level programming languages
  • Low-level programming languages
Figure 1.1

1.1.1 High-level programming languages

It is easy to write software programs in High-Level Languages (HLL) such as C, C++, Java, Python, and so on. Logically, a high-level language is very close to how we generally speak. The English instructions that we use in Java, Python, or any other HLL are very close to the English that we use for conversation. High-level languages have English words and mathematical symbols that are easily understood by coders. However, computer hardware can only understand the language of ‘0’s and ‘1’s and so it is a must to convert code written in the HLL Program to a format that a machine can understand. Hence, the code has to undergo compilation or interpretation before being executed by the computer. High-level languages are portable, which means that you can run the same code on different machines.

1.1.2 Low-level programming languages

Low-level programming languages can be easily interpreted and understood by a computer. A computer can easily understand the basic instructions of a low-level language. Making sense out of such programming language can be a difficult task for a normal human brain. Low-level programming languages are needed for writing programs for specific computer hardware or architecture. It is necessary to have extensive knowledge about a system’s hardware and its configuration to work with a low-level programming language. There are two types of low-level programming languages:
  • Machine language
  • Assembly language
Both machine language and assembly language are hardware-specific and are not portable.

1.1.2.1 Machine language

Machine language is the language of binary code - ‘0’s and ‘1’s. A computer can understand machine language directly, and no further translation is required. It is the lowest level of computer language. All instructions in machine language are in binary code so, 1100011100010101000011 can be a computer instruction. Software programmers never need to look at the machine language code. It is only viewed by those who build software compilers and operating systems. Machine languages used for programming in first-generation computers are called First Generation Language (1GL). CPU directly executes machine language program instructions; translation is not required. Hence, it is fast and efficient. However, fixing an error in machine language can be a very tedious job.

1.1.2.2 Assembly language

Assembly language is the Second Generation Language (2GL). It is a step above machine language, and a step closer to high-level language. It became popular in the 1950s because it used letters, symbols, and few simpler terms like ADD, MOV, SUB, and so on. These were simpler than using the complex series of ‘0’s and ‘1’s. However, a computer does not understand assembly language instructions unless converted to machine language using an assembler. Assembly language is quite complicated. It may be one step above machine language but not ideal for writing complex code.

1.2 Language processors

We all know that computers cannot process programming languages and instructions directly. A tool is required to convert/translate the code into machine language. The tools used for converting programming language (high-level language or assembly language) to machine code are called language processors or language translators. These language processors convert the code into binary code and inform the programmer if there is an error in the code. The language processors are of three types (Figure 1.2):
  • Assembler
  • Compiler
  • Interpreter
Although assembly language is machine-dependent yet, it has its own sets of instructions and is more programmer-friendly than machine-friendly. Just like high-level language, assembly language also requires the conversion of instructions to machine language. A program written ina high-level language is known ...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. About the Author
  6. About the Reviewer
  7. Acknowledgement
  8. Preface
  9. Errata
  10. Table of Contents
  11. 1. Introduction
  12. 2. Python Basics
  13. 3. Numbers, Operators and In-built Functions
  14. 4. Strings
  15. 5. Lists and Arrays
  16. 6. Tuples and Dictionaries
  17. 7. Sets and Frozen Sets
  18. 8. Program Flow Control in Python
  19. Index