
Python All-in-One For Dummies
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Everything you need to know to get into Python coding, with 7 books in one
Python All-in-One For Dummies is your one-stop source for answers to all your Python questions. From creating apps to building complex web sites to sorting big data, Python provides a way to get the work done. This book is great as a starting point for those new to coding, and it also makes a perfect reference for experienced coders looking for more than the basics. Apply your Python skills to data analysis, learn to write AI-assisted code using GitHub CoPilot, and discover many more exciting uses for this top programming language.
- Get started coding in Python-even if you're new to computer programming
- Reference all the essentials and the latest updates, so your code is air-tight
- Learn how Python can be a solution for large-scale projects and big datasets
- Accelerate your career path with this comprehensive guide to learning Python
Experienced and would-be coders alike will love this easy-to-follow guide to learning and applying Python.
More details
Other editions
Additional editions

Persons
John C. Shovic, PhD, is a computer science faculty member specializing in robotics and artificial intelligence at the University of Idaho.
Alan Simpson is a web development professional and prolific tech author with more than 100 publications to his credit.
Content
Introduction 1
Book 1: Getting Started 7
Chapter 1: Starting with Python 9
Chapter 2: Using Interactive Mode, Getting Help, and Writing Apps 21
Chapter 3: Python Elements and Syntax 37
Chapter 4: Building Your First Python Application 45
Book 2: Understanding Python Building Blocks 65
Chapter 1: Working with Numbers, Text, and Dates 67
Chapter 2: Controlling the Action 109
Chapter 3: Speeding Along with Lists and Tuples 131
Chapter 4: Cruising Massive Data with Dictionaries 155
Chapter 5: Wrangling Bigger Chunks of Code 181
Chapter 6: Doing Python with Class 203
Chapter 7: Sidestepping Errors 239
Book 3: Working with Libraries 257
Chapter 1: Working with External Files 259
Chapter 2: Juggling JSON Data 297
Chapter 3: Interacting with the Internet 317
Chapter 4: Libraries, Packages, and Modules 335
Book 4: Using Artificial Intelligence 351
Chapter 1: Demystifying Artificial Intelligence 353
Chapter 2: Building a Neural Network 363
Chapter 3: Doing Machine Learning 393
Chapter 4: Playing Around with AI on Cards, Sticks, and in the Cloud 415
Book 5: Doing Data Science 427
Chapter 1: Understanding the Five Areas of Data Science 429
Chapter 2: Exploring Big Data 437
Chapter 3: Using Big Data from Google Cloud 453
Book 6: Talking to Hardware 471
Chapter 1: Introducing Physical Computing 473
Chapter 2: No Soldering! Using Grove Connectors for Building 489
Chapter 3: Sensing the World 503
Chapter 4: Making Things Move 525
Book 7: Building Robots 553
Chapter 1: Introducing Robotics 555
Chapter 2: Building Your First Python Robot 563
Chapter 3: Programming Your Robot Rover 583
Chapter 4: Using Artificial Intelligence in Robotics 611
Index 649
Introduction
The power of Python is real. The Python language is becoming more and more popular, and in 2017 it became the most popular language in the world, according to IEEE Spectrum. Now in 2024, Python is still one of the most widely used languages, if not the most widely used language, in the world. This is especially true for the most modern applications including artificial intelligence, data science, and robotics.
Python is the number-one language because it's easy to learn and use, due partly to its simplified syntax and natural-language flow but also to the amazing user community and the breadth of applications available.
About This Book
This book is a reference manual to guide you through the process of learning Python and how to use it in modern computer applications, such as data science, artificial intelligence, physical computing, and robotics. If you're looking to learn a little about a lot of exciting things, this is the book for you. It gives you an introduction to the topics that you'll need to explore more deeply.
Python All-in-One For Dummies, 3rd Edition guides you through the Python language and then takes you on a tour through some cool libraries and technologies (the Raspberry Pi, robotics, AI, data science, and more) that all revolve around the Python language. When you work on new projects and new technologies, Python is there with a diverse number of libraries just waiting for you to use.
This is a hands-on book, with examples and code throughout. You are expected to enter the code, run it, and then modify it to do what you want. You don't just buy a robot; you build it so that you can understand all the pieces and make sense of the way Python works with the robot to control its motors and sensors. Artificial intelligence is complicated, but Python helps make a significant part of it accessible. Data science is complicated, but Python helps you do data science more easily. Robotics is complicated, but Python gives you the code that controls the robot. Python even enables you to tie these pieces together and use, say, AI in robotics.
In this book, we take you through the basics of the Python language in small, easy-to-understand steps. After we introduce you to the language, we step into the world of artificial intelligence, exploring programming in machine learning and neural networks using Python and TensorFlow and working on real problems and real software, not just toy applications.
After that, we're off to the exciting world of big data and data science with Python. We look at big public datasets such as medical and environmental data.
Finally, you get to experience the magic of what we call physical computing. Using the inexpensive, small, and incredibly popular Raspberry Pi computer, we show you how to use Python to control motors and read sensors. This is a lead-up to the final minibook, "Building Robots," where you build a robot and control it with Python and your own programs, even using artificial intelligence. This is not your mother's RC car.
Python data science, robotics, AI, and fun all in the same book.
This book won't make you understand everything about these fields, but it will give you a great introduction to the terminology and the power of Python in all these fields. Enjoy the book and go forth and learn more afterward.
Foolish Assumptions
We assume that you know how to use a computer in a basic way. If you can turn on the computer and use a mouse, you're ready for this book. We assume that you don't know how to program yet, although you will have some skills in programming by the end of the book. If we're wrong and you already know Python (or some other computer language), jump ahead to Book 4 and dig right into learning something new. Our intent is to guide you through the language of Python and then through some of the amazing technologies and devices that use Python. We provide complete examples. If you get stuck on something, look it up on the web, read a tutorial, and then come back to it.
What to Buy to Do the Projects in This Book
To complete the projects in Books 4 through 7, you need a Raspberry Pi 3B+ starter kit at https://amzn.to/2WzYdoY or a Raspberry PI 4B Starter Kit at https://amzn.to/3nIH8W8. In addition, you need the items listed in this section, organized by minibook.
If you want to use a Raspberry Pi 4B in the robot in Book 7, it will dramatically reduce the battery life, and with some types of batteries the robot may not be able to boot the Pi 4B.
Book 6
For building the projects in Book 6, you need the following:
- Pi2Grover board at
https://shop.switchdoc.com. (You can get $5.00 off the board atshop.switchdoc.comby using the discount code PI2DUMMIES at checkout.) - Grove blue LED module, which includes a Grove cable, at
www.seeedstudio.com. - A package of Grove male jumper patch cables, specifically the Grove-4-male-pin-to-Grove-conversion cables,
https://mouser.comorwww.seeedstudio.com. - A package of female-to-Grove patch cables at
mouser.comorwww.seeedstudio.com. - Grove HDC1080 I2C temperature and humidity sensor at
https://mouser.com,https://amazon.com, orwww.seeedstudio.com. If you buy a non-Grove sensor on Amazon, you'll need a female-to-Grove patch cable, as discussed in Chapter 2 of Book 6. You can get a female-to-Grove patch cable atwww.mouser.comorwww.seeedstudio.com. - Grove oxygen sensor at
www.seeedstudio.comorhttps://amazon.com. - Pi2Grover Raspberry-Pi-to-Grove converter at
https://shop.switchdoc.com. - Grove four-channel, 16-bit analog-to-digital converter at
https://shop.switchdoc.com. - Grove I2C motor drive (with a Grove cable) at
www.seeedstudio.comorhttps://amazon.com. - Two small DC motors at
www.adafruit.com/product/711orhttps://amazon.com. - SG90 micro servo motor at
www.ebay.comorhttps://amazon.com. These motors are inexpensive, so you may end up having to buy two or more for under $10. - 28BYJ-48 ULN2003 5V stepper motor at
www.ebay.comorhttps://amzn.to/2BuNDVl. This type of motor is inexpensive, so you may end up having to buy five for $12. Make sure you get the ones with the driver boards (such as the ones at theAmazon.comlink).
Book 7
For the robot in Book 7, purchase the following:
- Adeept Raspberry Pi PiCar-B. Make sure you buy the PiCar-B and not the PiCar-A. Look for "Adeept Mars Rover PiCar-B." You can buy the PiCar-B at
Amazon.comhttps://amzn.to/36dukPU,www.ebay.com, andwww.adeept.com. - Two 18650 3.7V LiPo 5000mAh batteries at
https://amazon.comand many other places.
Icons Used in This Book
What's a Dummies book without icons pointing you in the direction of truly helpful information that's sure to speed you along your way? Here we briefly describe each icon we use in this book.
The Tip icon points out helpful information that's likely to make your job easier.
This icon marks a generally interesting and useful fact - something you may want to remember for later use.
The Warning icon highlights lurking danger. When we use this icon, we're telling you to pay attention and proceed with caution.
When you see this icon, you know that there's techie-type material nearby. If you're not feeling technical-minded, you can skip this information.
Beyond the Book
In addition to the material in the print or e-book you're reading right now, this product also comes with some access-anywhere goodies on the web. To get this material, simply go to www.dummies.com and search for "Python All-in-One For Dummies cheat sheet" in the Search box. In addition, we provide all the source code for this book at www.dummies.com/go/pythonaiofd3e. Click Downloads in the left column, and you'll see the code links organized by minibook.
There are two downloadable image files used to create the SDCards for the Raspberry Pi computers used in this book. They are also at www.dummies.com/go/pythonaiofd3e and are as follows:
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.