Chapter 2

Programming in Python

IN THIS CHAPTER

check Learning the essentials of the Python language

check Working with variables and constants

check Creating your own function definitions

check Working with if logic

check Using lists

check Looping with for loops

In the preceding chapter, you learn how to create a basic Python program that lights up an LED connected to one of the Raspberry Pi’s digital output ports. Getting the Python programming environment set up correctly is no small accomplishment, so by all means you should congratulate yourself. Well done!

However, you need to know a little more than how to turn on an LED to call yourself a Raspberry Pi programmer. In this chapter, you learn enough Python programming features to perform truly useful things with the circuits you connect to your Raspberry Pi. You learn how to work with basic Python programming features such as variables, function definitions,

Get Electronics All-in-One For Dummies, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.