ISBN-13: 9781119860259 / Angielski / Miękka / 2022 / 250 str.
ISBN-13: 9781119860259 / Angielski / Miękka / 2022 / 250 str.
Chapter 1 Getting Ready to Work with PythonUnderstanding What Python Is and Does 4Choose the Right Version of Python 6Install Python on Windows 8Install Python on the Mac 12Install Python on Linux If Necessary 14Learn About Development Tools for Python 16Download and Install Visual Studio Code 20Get Started with Visual Studio Code and Apply a Theme 22Install Visual Studio Code Extensions for Python 24Configure Visual Studio Code for Working with Python 26Chapter 2 Writing and Running Your First Python CodeUnderstanding the main() Function 30Create and Save a New Script in Visual Studio Code 32Write and Run Code in Visual Studio Code 34Execute Python Commands in a Terminal Window 38Run a Python Script in a Terminal Window 39Understanding Comments in Python 40Add Comments to Your Code 42Grasp Importing Modules and Objects 44Import Modules and Use Their Methods 48Chapter 3 Getting Started with VariablesUnderstanding Variables and Their Usage 52Understanding Python's Data Types 54Work with Integers 58Work with Floating-Point Values 60Work with Boolean Values 62Work with Tuples 64Work with Sets 66Start Working with Strings 68Start Working with Lists 70Start Working with Dictionaries 72Convert Data from One Type to Another 74Chapter 4 Working with Files and DirectoriesUnderstanding Working with Files and Directories 78Load the os Module and List Files and Directories 80Navigate Among Directories 82Create and Delete Directories 84Rename, Move, and Copy Files and Directories 88Get Information About the User and System 92Split a File Path into Its Components 94Understanding Python's open() Function 96Understanding Python's Ways of Closing Files 97Open a File If It Exists; If Not, Create It 98Check an Open File's Status and Close It 100Write Data to a File 102Open a File for Both Reading and Writing 104Append Data to a File 106Read a Text File 108Chapter 5 Working with Python's OperatorsMeet the Arithmetic Operators 112Work with the Arithmetic Operators 114Meet the Assignment Operators 116Work with the Assignment Operators 117Meet the Comparison Operators 118Work with the Comparison Operators 119Meet the Logical Operators 120Work with the Logical Operators 121Meet the Identity Operators 122Work with the Identity Operators 123Meet the Membership Operators 124Work with the Membership Operators 125Meet the Bitwise Operators 126Work with the Bitwise Operators 127Chapter 6 Making Decisions with if StatementsLearn the Essentials of if Statements 130Understanding the if Statement 132Create an if Statement 133Understanding the if else Statement 134Create an if else Statement 135Understanding the if elif Statement 136Create an if elif Statement 137Understanding the if elif else Statement 138Create an if elif else Statement 139Understanding Nested if Statements 140Create Nested if Statements 141Chapter 7 Repeating Actions with LoopsUnderstanding Python's Loops 144Understanding How for Loops Work 146Create for Loops 148Understanding How while Loops Work 150Create while Loops 152Understanding break Statements in Loops 154Using a break Statement to Exit a Loop Early 155Understanding continue Statements in Loops 156Using a continue Statement in a Loop 157Understanding else Statements in Loops 158Using an else Statement in a Loop 159Understanding Loop Nesting 160Nest Loops to Create Complex Repetition 161Chapter 8 Working with FunctionsUnderstanding Functions and Their Syntax 164Understanding Function Parameters and Returns 166Using Python's Built-In Functions 168Create a Function with Parameters and a Return 172Create a Function with a Parameter But No Return 173Create a Function with No Parameters But a Return 174Create a Function with No Parameters and No Return 176Create a Function That Returns Multiple Values 177Create a Function with Optional Parameters 178Chapter 9 Working with TextLearn the Essentials of Strings 182Create Single-Line Strings 184Create Multiline Strings 186Meet Python's String Methods 188Return Information About a String 190Transform and Clean Up a String 192Return Part of a String via Slicing 194Concatenate and Repeat Strings 196Search for One String Inside Another String 198Check and Change String Capitalization 200Meet Python's Tools for Building Strings 204Build Strings with the Interpolation Operator 210Build Strings with the .format Method 212Build Strings with f-Strings 214Build Strings with Template Strings 216Chapter 10 Handling ErrorsUnderstanding the Various Types of Errors 220Identify Common Python Errors 222Meet the try except Block 224Cause Errors and Trap Exceptions 226Raise an Exception Manually 228Add an else Block or a finally Block 229Create Nested try except Blocks 230Create Custom Exceptions 232Chapter 11 Working with Lists and DictionariesUnderstanding Lists and Their Use 236Create a List 238Meet Python's List Methods 239Add Items to a List 240Remove Items from a List 242Locate Items and Access Data in a List 244Sort the Items in a List 246Understanding Dictionaries and Their Use 248Create a Dictionary and Return Values 250Meet Python's Dictionary Methods 251Create a Dictionary from an Existing Iterable 252Add Key/Value Pairs to a Dictionary 254Remove Key/Value Pairs from a Dictionary 256Return Keys and Values from a Dictionary 258Chapter 12 Working with ClassesUnderstanding Classes and Instances 262Create a Class and Instantiate Instances 264Understanding Class and Instance Attributes 266Set Class and Instance Attributes 268Grasp Class, Instance, and Static Methods 270Create an Instance Method 274Create a Class Method 275Create a Static Method 276Review the Class's Code 277Index 278
1997-2024 DolnySlask.com Agencja Internetowa