Home > Sample chapters

Working with variables

In this sample chapter from Begin to Code with Python, learn how to create variables in Python programs that work with numbers and text.

What you will learn

In this chapter, you’ll build more Python programs. You’ll discover how programs store data using variables, and you’ll learn how Python manages diverse kinds of data that can be stored by a program. You’ll learn that computers don’t store every value accurately, and you’ll learn how a program can request a value from the user and then do something with it. By the end of this chapter, you’ll be able to create useful programs.

  • Variables in Python

  • Working with text

  • Working with numbers

  • Weather snaps

  • What you have learned