Introduction to Python Programming
eBook - ePub

Introduction to Python Programming

Gowrishankar S, Veena A

Buch teilen
  1. 444 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Introduction to Python Programming

Gowrishankar S, Veena A

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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


Häufig gestellte Fragen

Wie kann ich mein Abo kĂźndigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich BĂźcher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bßcher zum Download ßber die App zur Verfßgung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die ßbrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht mÜglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst fßr Lehrbßcher, bei dem du fßr weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit ßber 1 Million Bßchern zu ßber 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
UnterstĂźtzt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhÜren kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Introduction to Python Programming als Online-PDF/ePub verfĂźgbar?
Ja, du hast Zugang zu Introduction to Python Programming von Gowrishankar S, Veena A im PDF- und/oder ePub-Format sowie zu anderen beliebten Bßchern aus Computer Science & Computer Science General. Aus unserem Katalog stehen dir ßber 1 Million Bßcher zur Verfßgung.

Information

Jahr
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...

Inhaltsverzeichnis