Book description
With an interesting mix of theory and practicals, explore Python and its features, and progress from beginner to being skilled in this popular scripting language
Key Features
- A comprehensive introduction to the world of Python programming
- Paves an easy-to-follow path for you to navigate through concepts
- Filled with over 90 practical exercises and activities to reinforce your learning
Book Description
After a brief history of Python and key differences between Python 2 and Python 3, you'll understand how Python has been used in applications such as YouTube and Google App Engine. As you work with the language, you'll learn about control statements, delve into controlling program flow and gradually work on more structured programs via functions.
As you settle into the Python ecosystem, you'll learn about data structures and study ways to correctly store and represent information. By working through specific examples, you'll learn how Python implements object-oriented programming (OOP) concepts of abstraction, encapsulation of data, inheritance, and polymorphism. You'll be given an overview of how imports, modules, and packages work in Python, how you can handle errors to prevent apps from crashing, as well as file manipulation.
By the end of this book, you'll have built up an impressive portfolio of projects and armed yourself with the skills you need to tackle Python projects in the real world.
What you will learn
- Use control statements
- Manipulate primitive and non-primitive data structures
- Use loops to iterate over objects or data for accurate results
- Write encapsulated and succinct Python functions
- Build Python classes using object-oriented programming
- Manipulate files on the file system (open, read, write, and delete)
Who this book is for
Python Fundamentals is great for anyone who wants to start using Python to build anything from simple command-line programs to web applications. Prior knowledge of Python isn't required.
Publisher resources
Table of contents
- Preface
-
Introducing Python
- Introduction
- Working with the Python Interactive Shell
- Writing and Running Simple Scripts
- Python Syntax
-
Variables
- Values
- Exercise 5: Checking the Type of a Value
- Type Conversion
- Exercise 6: Assigning Variables
- Exercise 7: Using Variables
- Multiple Assignment
- Activity 3: Using Variables and Assign Statements
- Naming Identifiers and Reserved Words
- Exercise 8: Python Keywords
- Python Naming Conventions
- Activity 4: Variable Assignment and Variable Naming Conventions
-
User Input, Comments, and Indentations
- User Input from the Keyboard
- Passing in a Prompt to the input Function
- Using Different Input Data Types in your Program
- Exercise 9: Fetching and Using User Input
- Comments
- Indentation
- Exercise 10: The Importance of Proper Indentation
- Activity 5: Fixing Indentations in a Code Block
- Activity 6: Implementing User Input and Comments in a Script
- Summary
- Data Types
- Control Statements
- Functions
- Lists and Tuples
- Dictionaries and Sets
- Object-Oriented Programming
- Modules, Packages, and File Operations
- Error Handling
-
Appendix A
-
Chapter 1: Introducing Python
- Activity 1: Working with the Python Shell
- Activity 2: Running Simple Python Scripts
- Activity 3: Using Variables and Assign Statements
- Activity 4: Variable Assignment and Variable Naming Conventions
- Activity 5: Fixing Indentations in a Code Block
- Activity 6: Implementing User Input and Comments in a Script
- Chapter 2: Data Types
- Chapter 3: Control Statements
- Chapter 4: Functions
- Chapter 5: Lists and Tuples
- Chapter 6: Dictionaries and Sets
- Chapter 7: Object-Oriented Programming
- Chapter 8: Modules, Packages, and File Operations
- Chapter 9: Error Handling
-
Chapter 1: Introducing Python
Product information
- Title: Python Fundamentals
- Author(s):
- Release date: October 2018
- Publisher(s): Packt Publishing
- ISBN: 9781789807325
You might also like
video
Python Fundamentals
After a brief history of Python and key differences between Python 2 and Python 3, you'll …
video
Practical Python: Learn Python Basics Step by Step - Python 3
Python is one of the most popular programming languages and gives a lot of scope and …
video
Python A-Z: Learn Python by Building 15 Projects and ChatGPT
This comprehensive Python course covers all fundamental concepts and advanced Python concepts, and you learn a …
video
Introduction to Python: Learn How to Program Today with Python
7+ Hours of Video Instruction Overview Python is a great, beginner-friendly programming language because it was …