Technical Roadmap

Creating Python variable

Let's create a variable in python.

How to Create a Variable

Use the Assignment Operator (=) to link a name to a value:

  • Basic Syntax:
    variable_name = value • Example: age = 20
  • Dynamic Typing:
    • Python detects the type automatically • Example: name = "Riya" (Python knows this is text)

Quick Revision

  • Variables are created upon assignment.
  • The = sign is used to assign values.
  • You can check a variable's memory address using id().
  • Python automatically clears unused memory (Garbage Collection).

Related Articles