O'Reilly logo

Raspberry Pi For Dummies, 3rd Edition by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11

Writing Programs in Python

IN THIS CHAPTER

check Using variables, strings, lists, and dictionaries

check Accepting user input and printing to the screen

check Using for and while loops

check Using conditional statements for decision-making

check Creating and using your own functions

In this chapter, we introduce you to Python, a powerful programming language that’s widely used commercially.

One of the best ways to learn programming is to study other people’s programs, so in this chapter, we talk you through two different programs: One is a simple calculator for multiplication tables; the other is an artificial intelligence simulation that enables you to chat with your Raspberry Pi.

You’ll probably find Python easiest to learn if you create the examples with us, but you can also download the finished programs from this book’s website. For more information on accessing the website, see the Introduction.

In a book of this size, it’s not possible to cover everything you can do with Python, but this chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required