Grokking Python Fundamentals
Vote

0% completed

Python - Variables

Variables are essential in any programming language. They are used to store data values. In Python, variables are created when you assign a value to them, and they don't require explicit declaration to reserve memory space. The variable is created the moment you first assign a value to it.

Creating Python Variables

Creating variables in Python is straightforward; you simply assign a value to a variable name.

Example

Explanation:

  • first_name holds the string "John".
  • age holds the integer 30.
  • height holds the floating point number 5.11.

.....

.....

.....

Like the course? Get enrolled and start learning!
D

durgeshdixit175

· a year ago

In deleting variable section, it's mentioned that printing a variable after deleting it will cause an exception/error. but that didn't happen. I tried removing comment from last 2 lines of that program (print statements after delete), and it just didn't print any value in console. But I didn't see any exception/error, please elaborate.