Introduction to Python Programming
eBook - ePub

Introduction to Python Programming

Gowrishankar S, Veena A

Condividi libro
  1. 444 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Introduction to Python Programming

Gowrishankar S, Veena A

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Introduction to Python Programming is written for students who are beginners in the field of computer programming. This book presents an intuitive approach to the concepts of Python Programming for students. This book differs from traditional texts not only in its philosophy but also in its overall focus, level of activities, development of topics, and attention to programming details. The contents of the book are chosen with utmost care after analyzing the syllabus for Python course prescribed by various top universities in USA, Europe, and Asia. Since the prerequisite know-how varies significantly from student to student, the book's overall overture addresses the challenges of teaching and learning of students which is fine-tuned by the authors' experience with large sections of students. This book uses natural language expressions instead of the traditional shortened words of the programming world. This book has been written with the goal to provide students with a textbook that can be easily understood and to make a connection between what students are learning and how they may apply that knowledge.

Features of this book

  • This book does not assume any previous programming experience, although of course, any exposure to other programming languages is useful


  • This book introduces all of the key concepts of Python programming language with helpful illustrations


  • Programming examples are presented in a clear and consistent manner


  • Each line of code is numbered and explained in detail


  • Use of f -strings throughout the book


  • Hundreds of real-world examples are included and they come from fields such as entertainment, sports, music and environmental studies


  • Students can periodically check their progress with in-chapter quizzes that appear in all chapters


Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Introduction to Python Programming è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Introduction to Python Programming di Gowrishankar S, Veena A in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Computer Science General. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2018
ISBN
9781351013215
1
Introduction
AIM
Setup a Python development environment and understand the importance of Open source software and its different licenses.
LEARNING OUTCOMES
At the end of the chapter, you are expected to
• Identify various domains where Python plays a significant role.
• Install and run the Python interpreter.
• Create and execute Python programs using PyCharm IDE and Jupyter Notebook.
• Understand the meaning of Open Source Software and its different licenses.
Python is a free general-purpose programming language with beautiful syntax. It is available across many platforms including Windows, Linux and Mac OS. Due to its inherently easy to learn nature along with Object Oriented features, Python is used to develop and demonstrate applications quickly. Python has the “batteries included” philosophy wherein the standard programming language comes with a rich set of built-in libraries. It’s a known fact that developers spend most of the time reading the code than writing it and Python can speed up software development. Hosting solutions for Python applications are also very cheap. Python Software Foundation (PSF) nurtures the growth of Python programming language. A versatile language like Python can be used not only to write simple scripts for handling file operations but also to develop massively trafficked websites for corporate IT organizations.
1.1 What Is a Program?
The ability to code computer programs is an important part of literacy in today’s society. A program is a set of instructions instructing a computer to do specific tasks. “Software” is a generic term used to describe computer programs. Scripts, applications, programs and a set of instructions are all terms often used to describe software. The software can be categorized into three categories,
System software includes device drivers, operating systems (OSs), compilers, disk formatters, text editors and utilities helping the computer to operate more efficiently. System software serves as a base for application software. It is also responsible for managing hardware components.
Programming software is a set of tools to aid developers in writing programs. The various tools available are compilers, linkers, debuggers, interpreters and text editors.
Application software is intended to perform certain tasks. Examples of application software include office suites, gaming applications, database systems and educational software. Application software can be a single program or a collection of small programs. This type of software is what consumers most typically think of as “Software.”
There are myriad of areas where programs are used like supermarkets, banks, insurance industries, process control, hospitals, offices, government institutions, education, research, telecommunication, transport industry, police, defense, multimedia applications, entertainment systems, library services and many more.
1.2 Programming Languages
Computers cannot write programs on their own as they don’t understand human needs unless we communicate with the computer through programming languages. A programming language is a computer language engineered to communicate instructions to a machine. Programs are created through programming languages to control the behavior and output of a machine through accurate algorithms, similar to the human communication process.
1.2.1 Machine Language
Machine language, also called machine code, is a low-level computer language that is designed to be directly understandable by a computer and it is the language into which all programs must be converted before they can be run. It is entirely comprised of binary, 0’s and 1’s. In machine language, all instructions, memory locations, numbers and characters are represented in 0’s and 1’s. For example, a typical piece of machine language might look like, 00000100 10000000.
The main advantage of machine language is that it can run and execute very fast as the code will be directly executed by a computer and the programs efficiently utilize memory.
Some of the disadvantages of machine language are,
• Machine language is almost impossible for humans to use because it consists entirely of numbers.
• Machine language programs are hard to maintain and debug.
• Machine language has no mathematical functions available.
• Memory locations are manipulated directly, requiring the programmer to keep track of every memory location.
1.2.2 Assembly Language
Machine language is extremely difficult for humans to read because it consists merely of patterns of bits (i.e., 0’s and 1’s). Thus, programmers who want to work at the machine language level instead usually use assembly language, which is a human-readable notation for the machine language. Assembly language replaces the instructions represented by patterns of 0’s and 1’s with alphanumeric symbols also called as mnemonics in order to make it easier to remember and work with them including reducing the chances of making errors. For example, the code to perform addition and subtraction is,
ADD 3, 5, result
SUB 1, 2, result
Because of alphanumeric symbols, assembly language is also known as Symbolic Programming Language. The use of mnemonics is an advantage over machine language. Since the computer cannot understand assembly language, it uses another program called assembler. Assembler is a program that is used to convert the alphanumeric symbols written in assembly language to machine language and this machine language can be directly executed on the computer.
Some of the disadvantages of Assembly language are,
• There are no symbolic names for memory locations.
• It is difficult to read.
• Assembly language is machine-dependent making it difficult for portability.
1.2.3 High-Level Language
High-level language is more like human language and less like machine language. High-level languages are written in a form that is close to our human language, enabling programmers to just focus on the problem being solved. High-level languages are platform independent which means that the programs written in a high-level language can be executed on different types of machines. A program written in the high-level language is called source program or source code and is any collection of human-readable computer instructions. However, for a computer to understand and execute a source program written in high-level language, it must be translated into machine language. This translation is done using either compiler or interpreter.
Advantages
• Easier to modify, faster to write code and debug as it uses English like statements.
• Portable code, as it is designed to run on multiple machines.
A compiler is a system software program that transforms high-level source code written by a software developer in a high-level programming language into a low-level machine language. The process of converting high-level programming language into machine language is known as compilation. Compilers translate source code all at once and the computer then executes the machine language that the compiler produced. The generated machine language can be later executed many times against different data each time. Programming languages like C, C++, C# and Java use compilers. Compilers can be classified into native-code compilers and cross compilers based on their input language, output language and the platform they run on. A compiler that is intended to produce machine language to run on the same platform that the compiler itself runs on is called a native-code compiler. A cross compiler produces machine language that is intended to run on a different platform than it runs on.
Not all source code is compiled. With some programming languages like Python, Ruby and Perl the source code is frequently executed directly using an interpreter rather than first compiling it and then executing the resulting machine language. An interpreter is a program that reads source code one statement at a time, translates the statement into machine language, executes the machine language statement, then continues with the next statement. It is generally faster to run compiled code than to run a program under an interpreter. This is largely because the interpreter must analyze each statement in the source code each time the program is executed and then perform the desired conversion, whereas this is not nec...

Indice dei contenuti