Details

Teach Yourself VISUALLY Python


Teach Yourself VISUALLY Python


Teach Yourself VISUALLY (Tech) 1. Aufl.

von: Guy Hart-Davis, Ted Hart-Davis

19,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 21.07.2022
ISBN/EAN: 9781119860266
Sprache: englisch
Anzahl Seiten: 304

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>A simple, straightforward, and hands-on roadmap to the world of computer programming with Python </b></p> <p><i>Teach Yourself VISUALLY: Python</i> is your personal guide to getting you started in programming. As one of the world's most popular—and most accessible—coding languages, Python is your gateway into the wide and wonderful world of computer science. This hands-on guide walks you through Python step by clearly illustrated step, from writing your very first Python code in a terminal window or the VS Code app through to creating your own lists, dictionaries, and custom classes.</p> <p>In the book, you’ll learn to:</p> <ul> <li>Install Python and the tools you need to work with it on Windows, macOS, and Linux</li> <li>Work with files and folders, manipulate text, and create powerful functions that do exactly what you want</li> <li>Write clean code that makes decisions effectively, repeats actions as needed, and handles any errors that occur</li> </ul> <p>A must-have resource for aspiring programmers starting from the very beginning, <i>Teach Yourself VISUALLY: Python</i> is also an indispensable handbook for programmers making a transition from another language.</p>
<p><b>Chapter 1 Getting Ready to Work with Python</b></p> <p>Understanding What Python Is and Does 4</p> <p>Choose the Right Version of Python 6</p> <p>Install Python on Windows 8</p> <p>Install Python on the Mac 12</p> <p>Install Python on Linux If Necessary 14</p> <p>Learn About Development Tools for Python 16</p> <p>Download and Install Visual Studio Code 20</p> <p>Get Started with Visual Studio Code and Apply a Theme 22</p> <p>Install Visual Studio Code Extensions for Python 24</p> <p>Configure Visual Studio Code for Working with Python 26</p> <p><b>Chapter 2 Writing and Running Your First Python Code</b></p> <p>Understanding the main() Function 30</p> <p>Create and Save a New Script in Visual Studio Code 32</p> <p>Write and Run Code in Visual Studio Code 34</p> <p>Execute Python Commands in a Terminal Window 38</p> <p>Run a Python Script in a Terminal Window 39</p> <p>Understanding Comments in Python 40</p> <p>Add Comments to Your Code 42</p> <p>Grasp Importing Modules and Objects 44</p> <p>Import Modules and Use Their Methods 48</p> <p><b>Chapter 3 Getting Started with Variables</b></p> <p>Understanding Variables and Their Usage 52</p> <p>Understanding Python’s Data Types 54</p> <p>Work with Integers 58</p> <p>Work with Floating‐Point Values 60</p> <p>Work with Boolean Values 62</p> <p>Work with Tuples 64</p> <p>Work with Sets 66</p> <p>Start Working with Strings 68</p> <p>Start Working with Lists 70</p> <p>Start Working with Dictionaries 72</p> <p>Convert Data from One Type to Another 74</p> <p><b>Chapter 4 Working with Files and Directories</b></p> <p>Understanding Working with Files and Directories 78</p> <p>Load the os Module and List Files and Directories 80</p> <p>Navigate Among Directories 82</p> <p>Create and Delete Directories 84</p> <p>Rename, Move, and Copy Files and Directories 88</p> <p>Get Information About the User and System 92</p> <p>Split a File Path into Its Components 94</p> <p>Understanding Python’s open() Function 96</p> <p>Understanding Python’s Ways of Closing Files 97</p> <p>Open a File If It Exists; If Not, Create It 98</p> <p>Check an Open File’s Status and Close It 100</p> <p>Write Data to a File 102</p> <p>Open a File for Both Reading and Writing 104</p> <p>Append Data to a File 106</p> <p>Read a Text File 108</p> <p><b>Chapter 5 Working with Python’s Operators</b></p> <p>Meet the Arithmetic Operators 112</p> <p>Work with the Arithmetic Operators 114</p> <p>Meet the Assignment Operators 116</p> <p>Work with the Assignment Operators 117</p> <p>Meet the Comparison Operators 118</p> <p>Work with the Comparison Operators 119</p> <p>Meet the Logical Operators 120</p> <p>Work with the Logical Operators 121</p> <p>Meet the Identity Operators 122</p> <p>Work with the Identity Operators 123</p> <p>Meet the Membership Operators 124</p> <p>Work with the Membership Operators 125</p> <p>Meet the Bitwise Operators 126</p> <p>Work with the Bitwise Operators 127</p> <p><b>Chapter 6 Making Decisions with if Statements</b></p> <p>Learn the Essentials of if Statements 130</p> <p>Understanding the if Statement 132</p> <p>Create an if Statement 133</p> <p>Understanding the if else Statement 134</p> <p>Create an if else Statement 135</p> <p>Understanding the if elif Statement 136</p> <p>Create an if elif Statement 137</p> <p>Understanding the if elif else Statement 138</p> <p>Create an if elif else Statement 139</p> <p>Understanding Nested if Statements 140</p> <p>Create Nested if Statements 141</p> <p>Chapter 7 Repeating Actions with Loops</p> <p>Understanding Python’s Loops 144</p> <p>Understanding How for Loops Work 146</p> <p>Create for Loops 148</p> <p>Understanding How while Loops Work 150</p> <p>Create while Loops 152</p> <p>Understanding break Statements in Loops 154</p> <p>Using a break Statement to Exit a Loop Early 155</p> <p>Understanding continue Statements in Loops 156</p> <p>Using a continue Statement in a Loop 157</p> <p>Understanding else Statements in Loops 158</p> <p>Using an else Statement in a Loop 159</p> <p>Understanding Loop Nesting 160</p> <p>Nest Loops to Create Complex Repetition 161</p> <p><b>Chapter 8 Working with Functions</b></p> <p>Understanding Functions and Their Syntax 164</p> <p>Understanding Function Parameters and Returns 166</p> <p>Using Python’s Built‐In Functions 168</p> <p>Create a Function with Parameters and a Return 172</p> <p>Create a Function with a Parameter But No Return 173</p> <p>Create a Function with No Parameters But a Return 174</p> <p>Create a Function with No Parameters and No Return 176</p> <p>Create a Function That Returns Multiple Values 177</p> <p>Create a Function with Optional Parameters 178</p> <p><b>Chapter 9 Working with Text</b></p> <p>Learn the Essentials of Strings 182</p> <p>Create Single‐Line Strings 184</p> <p>Create Multiline Strings 186</p> <p>Meet Python’s String Methods 188</p> <p>Return Information About a String 190</p> <p>Transform and Clean Up a String 192</p> <p>Return Part of a String via Slicing 194</p> <p>Concatenate and Repeat Strings 196</p> <p>Search for One String Inside Another String 198</p> <p>Check and Change String Capitalization 200</p> <p>Meet Python’s Tools for Building Strings 204</p> <p>Build Strings with the Interpolation Operator 210</p> <p>Build Strings with the .format Method 212</p> <p>Build Strings with f‐Strings 214</p> <p>Build Strings with Template Strings 216</p> <p><b>Chapter 10 Handling Errors</b></p> <p>Understanding the Various Types of Errors 220</p> <p>Identify Common Python Errors 222</p> <p>Meet the try except Block 224</p> <p>Cause Errors and Trap Exceptions 226</p> <p>Raise an Exception Manually 228</p> <p>Add an else Block or a finally Block 229</p> <p>Create Nested try except Blocks 230</p> <p>Create Custom Exceptions 232</p> <p><b>Chapter 11 Working with Lists and Dictionaries</b></p> <p>Understanding Lists and Their Use 236</p> <p>Create a List 238</p> <p>Meet Python’s List Methods 239</p> <p>Add Items to a List 240</p> <p>Remove Items from a List 242</p> <p>Locate Items and Access Data in a List 244</p> <p>Sort the Items in a List 246</p> <p>Understanding Dictionaries and Their Use 248</p> <p>Create a Dictionary and Return Values 250</p> <p>Meet Python’s Dictionary Methods 251</p> <p>Create a Dictionary from an Existing Iterable 252</p> <p>Add Key/Value Pairs to a Dictionary 254</p> <p>Remove Key/Value Pairs from a Dictionary 256</p> <p>Return Keys and Values from a Dictionary 258</p> <p><b>Chapter 12 Working with Classes</b></p> <p>Understanding Classes and Instances 262</p> <p>Create a Class and Instantiate Instances 264</p> <p>Understanding Class and Instance Attributes 266</p> <p>Set Class and Instance Attributes 268</p> <p>Grasp Class, Instance, and Static Methods 270</p> <p>Create an Instance Method 274</p> <p>Create a Class Method 275</p> <p>Create a Static Method 276</p> <p>Review the Class’s Code 277</p> <p>Index 278</p>
<p><b><i>Teach Yourself</i> VISUALLY<sup>™</sup> </b></p> <p>Are you a visual learner? Do you prefer instructions that <i>show</i> you how to do something—and skip the long-winded explanations? If so, then this book is for you. Open it up and you’ll find clear, step-by-step screen shots that show you how to tackle over a hundred Python tasks. Each task-based spread covers a single technique, sure to help you get up and running with Python in no time. <p><b>You’ll learn to: <ul><li>Install Python and get coding</li> <li>Work interactively and create scripts</li> <li>Manipulate directories and files</li> <li>Make decisions and repeat actions</li> <li>Develop powerful functions</b></li></ul> <p><b>Designed for visual learners <ul><li>Two-page lessons break big topics into bite-sized modules</li> <li>Succinct explanations walk you through step by step </li> <li>Full-color screen shots demonstrate each task </li> <li>Helpful sidebars offer practical tips and tricks </b></li></ul>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €