Python Fundamentals|
Creating Variables

Variables and Data Types

Python

Creating Variables

Variables

Variables store data for later use. In Python, you create a variable with =.

name = "Alice"
age = 25
height = 5.6

Data Types

TypeExampleDescription

str"Hello"Text (string)
int42Whole number
float3.14Decimal number
boolTrueTrue or False

Your Task

1. Create a variable name with the value "Python"

  • Create a variable year with the value 1991
  • Print both variables
  • Code Editor
    Loading PYTHON engine...
    Loading...
    Loading Python engine...

    Run your code to see output