2. Variables and Data Types

  • How to assign and use variables
  • Python variable naming convention
  • Learn and use some of data types in Python
  • What is dynamically-typed language?
  • How to convert data types
  • Work with Strings!

What are Variables? 📦

Variables are like containers

Store some data, pull it out later

They can hold all sorts of things

Like numbers, booleans, and strings

Variable Assignment

It's a named symbol that holds a value.

x = 100
number_of_apples = 1
print(number_of_apples + 1)
101

variable_name = "some_value_here"

Naming Restrictions

In python you can use any name that you want to naming your variable with some restrictions:

1. Variables must start with letter or underscore

2. The rest of the name must consist of letters, numbers, or underscores

3. Names are case-sensitive

2. Var

By Ali Montajebi