Ravindra BagaleCourses & study guides मराठी Track your progress

Python Variables and Data Types Explained for Beginners (int, float, str, bool)

Ravindra Bagale's Tip — Chala mitrano

Every number in a report, every customer name and every yes/no flag is stored in a variable. Today we learn how Python stores values and how to check their type. This is the base of pandas columns.

What you will learn in this chapter

  • What a variable is and how to name it
  • The four basic types: int, float, str and bool
  • How to check a type with type()
  • How to convert between types
  • Basic maths operators
  • Why None means "no value"

Practice data

All names, shops, banks, hospitals and amounts in this chapter are made up for learning. They are not real people or real company numbers.

Concepts in this chapter

  1. P2.1What Is a Variable in Python
  2. P2.2Python Data Types: int, float, str and bool
  3. P2.3How to Convert Data Types in Python (Type Casting)
  4. P2.4Python Arithmetic Operators with Examples
  5. P2.5What Is None in Python