چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

Learn to Program with Python 3 : a Step-by-Step Guide to Programming, Second Edition

Irv Kalb

قیمت نهایی

۴۴٬۰۰۰ تومان۴۹٬۰۰۰ تومان۱۰٪ تخفیف
  • تخفیف زمان‌دار−۵٬۰۰۰ تومان

۵٬۰۰۰ تومان صرفه‌جویی نسبت به قیمت اصلی

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

نویسنده
Irv Kalb
ناشر
Apress
سال انتشار
۲۰۱۸
فرمت
PDF
زبان
انگلیسی
حجم فایل
۴٫۱ مگابایت
شابک
9781484238783، 9781484238790، 9781484238806، 1484238788، 1484238796، 148423880X

دربارهٔ کتاب

Move from zero knowledge of programming to comfortably writing small to medium-sized programs in Python. Fully updated for Python 3, with code and examples throughout, the book explains Python coding with an accessible, step-by-step approach designed to bring you comfortably into the world of software development. Real–world analogies make the material understandable, with a wide variety of well-documented examples to illustrate each concept. Along the way, you'll develop short programs through a series of coding challenges that reinforce the content of the chapters. Learn to Program with Python 3 guides you with material developed in the author's university computer science courses. The author's conversational style feels like you're working with a personal tutor. All material is thoughtfully laid out, each lesson building on previous ones. What You'll Learn Understand programming basics with Python, based on material developed in the author's college courses Learn core concepts: variables, functions, conditionals, loops, lists, strings, and more Explore example programs including simple games you can program and customize Build modules to reuse your own code Who This Book Is For This book assumes no prior programming experience, and would be appropriate as text for a high school or college introduction to computer science. Table of Contents 5 About the Author 13 About the Technical Reviewer 14 Acknowledgments 15 Chapter 1: Getting Started 16 What Is Python? 17 Installing Python 17 IDLE and the Python Shell 18 Hello World 19 Creating, Saving, and Running a Python File 21 IDLE on Multiple Platforms 23 Summary 24 Chapter 2: Variables and Assignment Statements 25 A Sample Python Program 26 The Building Blocks of Programming 28 Four Types of Data 29 Integers 29 Floats 29 Strings 30 Booleans 30 Examples of Data 31 Form with Underlying Data 32 Variables 33 Assignment Statements 38 Variable Names 41 Naming Convention 42 Keywords 43 Case Sensitivity 45 More Complicated Assignment Statements 46 Print Statements 47 Simple Math 49 Order of Operations 52 First Python Programs 53 Shorthand Naming Convention 55 Adding Comments 57 Full-Line Comment 57 Add a Comment After a Line of Code 58 Multiline Comment 58 Whitespace 59 Errors 60 Syntax Error 60 Exception Error 62 Logic Error 63 Summary 63 Chapter 3: Built-in Functions 64 Overview of Built-in Functions 64 Function Call 65 Arguments 65 Results 66 Built-in type Function 66 Getting Input from the User 68 Conversion Functions 69 int Function 70 float Function 70 str Function 70 First Real Programs 71 Concatenation 74 Another Programming Exercise 75 Using Function Calls Inside Assignment Statements 76 Summary 78 Chapter 4: User-Defined Functions 79 A Recipe as an Analogy for Building Software 80 Ingredients 80 Directions 80 Definition of a Function 83 Building Our First Function 84 Calling a User-Defined Function 85 Receiving Data in a User-Defined Function: Parameters 88 Building User-Defined Functions with Parameters 90 Building a Simple Function That Does Addition 93 Building a Function to Calculate an Average 93 Returning a Value from a Function: The return Statement 94 Returning No Value: None 96 Returning More Than One Value 97 Specific and General Variable Names in Calls and Functions 98 Temperature Conversion Functions 100 Placement of Functions in a Python File 101 Never Write Multiple Copies of the Same Code 102 Constants 103 Scope 105 Global Variables and Local Variables with the Same Names 109 Finding Errors in Functions: Traceback 110 Summary 113 Chapter 5: if, else, and elif Statements 115 Flowcharting 116 The if Statement 119 Comparison Operators 121 Examples of if Statements 121 Nested if Statement 123 The else Statement 123 Using if/else Inside a Function 126 The elif Statement 127 Using Many elif Statements 130 A Grading Program 132 A Small Sample Program: Absolute Value 132 Programming Challenges 135 Negative, Positive, Zero 135 isSquare 137 isEven 140 isRectangle 142 Conditional Logic 144 The Logical not Operator 144 The Logical and Operator 145 The Logical or Operator 147 Precedence of Comparison and Logical Operators 148 Booleans in if Statements 148 Program to Calculate Shipping 149 Summary 153 Chapter 6: Loops 154 User’s View of the Game 155 Loops 156 The while Statement 158 First Loop in a Real Program 161 Increment and Decrement 162 Running a Program Multiple Times 163 Python’s Built-in Packages 165 Generating a Random Number 166 Simulation of Flipping a Coin 168 Other Examples of Using Random Numbers 169 Creating an Infinite Loop 171 A New Style of Building a Loop: while True, and break 171 Asking If the User Wants to Repeat: the Empty String 174 Pseudocode 175 Building the Guess the Number Program 175 Playing a Game Multiple Times 182 Error Detection with try/except 184 The continue Statement 186 Full Game 187 Building Error-Checking Utility Functions 189 Coding Challenge 190 Summary 192 Chapter 7: Lists 194 Collections of Data 195 Lists 196 Elements 196 Python Syntax for a List 197 Empty List 198 Position of an Element in a List: Index 198 Accessing an Element in a List 200 Using a Variable or Expression as an Index in a List 201 Changing a Value in a List 203 Using Negative Indices 203 Building a Simple Mad Libs Game 204 Adding a List to Our Mad Libs Game 206 Determining the Number of Elements in a List: The len Function 207 Programming Challenge 1 209 Using a List Argument with a Function 211 Accessing All Elements of a List: Iteration 214 for Statements and for Loops 215 Programming Challenge 2 217 Generating a Range of Numbers 218 Programming Challenge 3 219 Scientific Simulations 220 List Manipulation 225 List Manipulation Example: an Inventory Example 227 Pizza Toppings Example 228 Summary 234 Chapter 8: Strings 235 len Function Applied to Strings 236 Indexing Characters in a String 236 Accessing Characters in a String 237 Iterating Through Characters in a String 238 Creating a Substring: A Slice 240 Programming Challenge 1: Creating a Slice 242 Additional Slicing Syntax 245 Slicing as Applied to a List 246 Strings Are Not Changeable 246 Programming Challenge 2: Searching a String 247 Built-in String Operations 248 Examples of String Operations 250 Programming Challenge 3: Directory Style 251 Summary 253 Chapter 9: File Input/Output 254 Saving Files on a Computer 255 Defining a Path to a File 256 Reading from and Writing to a File 258 File Handle 259 The Python os Package 260 Building Reusable File I/O Functions 261 Example Using Our File I/O Functions 263 Importing Our Own Modules 264 Saving Data to a File and Reading It Back 266 Building an Adding Game 269 Programming Challenge 1 269 Programming Challenge 2 270 Writing/Reading One Piece of Data to and from a File 272 Writing/Reading Multiple Pieces of Data to and from a File 275 The join Function 275 The split Function 276 Final Version of the Adding Game 277 Writing and Reading a Line at a Time with a File 280 Example: Multiple Choice Test 284 A Compiled Version of a Module 290 Summary 291 Chapter 10: Internet Data 292 Request/Response Model 292 Getting a Stock Price 294 Pretending to Be a Browser 295 API 297 Requests with Values 297 API Key 298 Example Program to Get Stock Price Information Using an API 300 Example Program to Get Weather Information 303 URL Encoding 306 Summary 308 Chapter 11: Data Structures 309 Tuples 310 Lists of Lists 313 Representing a Grid or a Spreadsheet 314 Representing the World of an Adventure Game 315 Reading a Comma-Separated Value (.csv) File 319 Dictionary 324 Using the in Operator on a Dictionary 327 Programming Challenge 328 A Python Dictionary to Represent a Programming Dictionary 330 Iterating Through a Dictionary 331 Combining Lists and Dictionaries 333 JSON: JavaScript Object Notation 336 Example Program to Get Weather Data 339 XML Data 342 Accessing Repeating Groupings in JSON and XML 346 Summary 349 Chapter 12: Where to Go from Here 350 Python Language Documentation 350 Python Standard Library 351 Python External Packages 352 Python Development Environments 353 Places to Find Answers to Questions 354 Projects and Practice, Practice, Practice 354 Summary 355 Index 356 Python is a general-purpose programming language. That means it was designed and developed to write software for a wide variety of disciplines. Python has been used to write applications to solve problems in biology, chemistry, financial analysis, numerical analysis, robotics, and many other fields. It is also widely used as a scripting language for use by computer administrators, who use it to capture and replay sequences of computer commands. It is different from a language like HTML (HyperText Markup Language), which was designed for the single purpose of allowing people to specify the layout of a web page.Once you learn the basic concepts of a programming language like Python, you find that you can pick up a new computer languages very quickly. No matter what the language (and there are many) the underlying concepts are very similar. The key things that you learn about-variables, assignment statements, if statements, while loops, function calls-are all concepts that are easily transferable to any other programming language. Installing Python Python was created in the 1990s by Guido van Rossum. He is affectionately known as Python's Benevolent Dictator for Life. The language has two current versions: 2.7 and 3.6. Version 2.7 is still widely used, but its "end of life" has recently been announced. Therefore, this version of the book will use the newer Python 3, as it is known. With respect to the contents of this book, there are only a few differences between the versions of the language. Where appropriate, I point out how something presented in Python 3 was handled in Python 2.Python is maintained as an open source project by a group called the Python Software Foundation. Because it is open source, Python is free. There is no single company that owns and/or sells the software. You can get everything you need to write and run all the Python programs in this book by simply downloading Python from the Internet. I'll explain how you can get it and install it.The center of the Python universe is at www.python.org.Bring up the browser of your choice and go to that address. The site changes over time, but the essential functionality should remain the same. On the main page, there should be a Downloads button or rollover. Once you're in the Downloads area, you Chapter 1 GettinG Started Front Matter ....Pages i-xvii Getting Started (Irv Kalb)....Pages 1-9 Variables and Assignment Statements (Irv Kalb)....Pages 11-49 Built-in Functions (Irv Kalb)....Pages 51-65 User-Defined Functions (Irv Kalb)....Pages 67-102 if, else, and elif Statements (Irv Kalb)....Pages 103-141 Loops (Irv Kalb)....Pages 143-182 Lists (Irv Kalb)....Pages 183-223 Strings (Irv Kalb)....Pages 225-243 File Input/Output (Irv Kalb)....Pages 245-282 Internet Data (Irv Kalb)....Pages 283-299 Data Structures (Irv Kalb)....Pages 301-341 Where to Go from Here (Irv Kalb)....Pages 343-348 Back Matter ....Pages 349-354 Move from zero knowledge of programming to comfortably writing small to medium-sized programs in Python. Fully updated for Python 3, with code and examples throughout, the book explains Python coding with an accessible, step-by-step approach designed to bring you into the world of software development. Real-world scenarios make the material understandable, with a wide variety of well-documented examples to illustrate each concept. Along the way, you'll develop short programs through a series of coding challenges that reinforce the content of the chapters Fully updated for Python 3, with code and examples throughout, this book explains Python coding with an accessible, step-by-step approach designed to bring you comfortably into the world of software development. -- Edited summary from book

کتاب‌های مشابه

Learn to Program with Python 3 : a Step-by-Step Guide to Programming, Second Edition

Learn to Program with Python 3 : a Step-by-Step Guide to Programming, Second Edition

۴۹٬۰۰۰ تومان

Learn to Program with Python 3 : a Step-by-Step Guide to Programming, Second Edition

Learn to Program with Python 3 : a Step-by-Step Guide to Programming, Second Edition

۴۹٬۰۰۰ تومان

Learn to Program with Python 3: A Step-by-Step Guide to Programming, 2nd Edition

Learn to Program with Python 3: A Step-by-Step Guide to Programming, 2nd Edition

۴۹٬۰۰۰ تومان

یادگیری برنامه‌نویسی با پایتون ۳: راهنمای گام به گام برنامه‌نویسی (ویرایش دوم)

یادگیری برنامه‌نویسی با پایتون ۳: راهنمای گام به گام برنامه‌نویسی (ویرایش دوم)

۴۹٬۰۰۰ تومان

Python Programming: A Step-by-Step Guide to Learning the Language

Python Programming: A Step-by-Step Guide to Learning the Language

۴۹٬۰۰۰ تومان

Python Programming: A Step-by-Step Guide to Learning the Language

Python Programming: A Step-by-Step Guide to Learning the Language

۴۹٬۰۰۰ تومان

Python Programming: The Ultimate Beginners Guide to Learn Python Machine Learning Step-by-Step

Python Programming: The Ultimate Beginners Guide to Learn Python Machine Learning Step-by-Step

۴۹٬۰۰۰ تومان

پایتون ۳: راهنمای گام به گام برای یادگیری آسان اصول زبان برنامه‌نویسی پایتون

پایتون ۳: راهنمای گام به گام برای یادگیری آسان اصول زبان برنامه‌نویسی پایتون

۴۹٬۰۰۰ تومان

Computer Programming for Beginners: 3 Books in 1: Step by Step Guide to Learn Programming, Python For Beginners, Python Machine Learning

Computer Programming for Beginners: 3 Books in 1: Step by Step Guide to Learn Programming, Python For Beginners, Python Machine Learning

۴۹٬۰۰۰ تومان

Computer Programming for Beginners: 3 Books in 1: Step by Step Guide to Learn Programming, Python For Beginners, Python Machine Learning

Computer Programming for Beginners: 3 Books in 1: Step by Step Guide to Learn Programming, Python For Beginners, Python Machine Learning

۴۹٬۰۰۰ تومان

Python For Beginners: A Practical and Step-by-Step Guide to Programming with Python

Python For Beginners: A Practical and Step-by-Step Guide to Programming with Python

۴۹٬۰۰۰ تومان

برنامه‌نویسی پایتون برای مبتدیان: راهنمای گام به گام برای یادگیری اصول برنامه‌نویسی کامپیوتر و زبان کامپیوتری پایتون

برنامه‌نویسی پایتون برای مبتدیان: راهنمای گام به گام برای یادگیری اصول برنامه‌نویسی کامپیوتر و زبان کامپیوتری پایتون

۴۹٬۰۰۰ تومان

قیمت نهایی

۴۴٬۰۰۰ تومان