Python Variables

Python Variables

Variables in Python are containers used to store data values. Python is a dynamically typed language, meaning you do not need to declare the data type of a variable. The data type is automatically inferred based on the value assigned to the variable. Additionally, Python allows you to reassign variables with different data types during the program execution.

1. Declaring Variables:

In Python, you can declare a variable simply by assigning a value to it. You do not need to explicitly declare the data type.

Syntax:

Variable_name = value

Example:

age_in_numeric = 25
# Here, ‘age_in_numeric’ is an integer variable, and ’25’ is its value.

age_in_words = ‘Twenty-Five’
# Here, ‘age_in_words’ is a string variable, and ‘Twenty-five’ is its value.

Course Video

YouTube Reference :