---
title: "What is meant by variable in python?"  
description: "What is meant by variable in python?"  
author: "Amrita Bhattacharjee"  
published: 2023-03-28  
updated: 2023-04-18  
canonical: https://www.mindstick.com/forum/157617/what-is-meant-by-variable-in-python  
category: "python"  
tags: ["python"]  
reading_time: 2 minutes  

---

# What is meant by variable in python?

What is meant by [variable](https://www.mindstick.com/articles/1807/objective-c-data-types-variables-object-creation) in [python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python)?Give suitable example.

## Replies

### Reply by Aryan Kumar

Basically, variable is a name that is used to refer to a value stored in the computer's memory. Variables are used to store data that can be used later in a program, and they can store different data types such as strings, numbers, or lists.

In python, creating or declaring a variable is so easy as compared to other programing languages. In other programing languages you need to declare variable as well as data type also. But in python you simply declare a variable as follows:

```python
name = “Aryan”
age = 22
```

variables can be updated or reassigned with a new value anytime in the program by simply assigning a new value to thee variable.

### Reply by Krishnapriya Rajeev

In Python, a variable is a name that refers to a value or object stored in the computer's memory. It is used to store data, which can be of any type such as numbers, strings, lists, dictionaries, or objects. We also need to follow certain naming conventions when creating a variable.

The naming convention for variables is as follows:

1. The variable name should begin with an alphabet or an underscore.
2. It can only contain alphabets, numbers, and underscore.
3. Special characters like $,%,#,&,@.-,^, etc, cannot be used.
4. Python Keywords like if, else, try, etc, cannot be used as variable names.
5. Variable names are case-sensitive.
6. Multi-word variable names are made more readable by representing them as:

a) Camel Case - The first letter of each word except the first is made capitalized.

Eg: mindStick

b) Snake Case - Words are separated using underscores. Eg: mind_stick

c) Pascal Case - Each word starts with a capital letter Eg: MindStick

To assign a value to a variable in Python, you simply use the equals sign (=) and write the variable name on the left side of the equals sign and the value you want to assign to it on the right side.

Example:

```plaintext
flag = 27
name = "MindStick"
boolval = True
```

Above shown are 3 variables of type integer, string, and boolean respectively.


---

Original Source: https://www.mindstick.com/forum/157617/what-is-meant-by-variable-in-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
