# What is Python Variable

- Link: https://technotaught.com/python-variable/
- Published: 2019-06-27T13:05:29+05:30
- Author: Prasant Vishwakarma

## What is Python variable?

A Variables play a very important role in other [Programming languages](https://technotaught.com/category/dsa-practical/),
and Python is no exception. A [Variable](https://www.facebook.com/technotaughts/?modal=admin_todo_tour)
allows you to store values by assigning it to a name, which can be used to refer
to the value later in the program

![python variable](https://technotaught.com/wp-content/uploads/2019/06/Python-Variables-
Tutorial-Types-with-example.png)

**python variable**

#### Creating Variables

Unlike other [programming languages](https://technotaught.com/category/java-practical/),
Python has no command for declaring variables. 
A variable is created the moment
you first assign a value to it.

#### `Example:`

    ```php
    >>> x=3   # x is the type of Int
    >>> print(x)
    3
    >>> print(x+3)
    6
    >>> print(x)
    3
    ```

The variable can be reassigned as many times as you want, in order to change their
value.

In python, the variables don’t have specific types, so you can assign a string to
variables, and later assign an integer to the same variables.

#### `Example:`

    ```php
    >>>x=45.23      # x is the type of Int
    >>> print(x)
    45.23
    >>> x="this is string"     # x is the type of String
    >>> print (x)
    this is string
    >>>print(x + "!")
    this is string!
    ```

 * To combine both text and a variable, Python uses the `+` character:

#### **Example:**

    ```php
    >>> x = "awesome"
    >>> print("Python is " + x)
    Python is awesome
    ```

### Share this:

 * [  X ](https://technotaught.com/python-variable/?share=twitter)
 * [  Facebook ](https://technotaught.com/python-variable/?share=facebook)
 * [More](https://technotaught.com/python-variable/#)

 * [  WhatsApp ](https://technotaught.com/python-variable/?share=jetpack-whatsapp)
 * [  LinkedIn ](https://technotaught.com/python-variable/?share=linkedin)
 * [  Email ](https://technotaught.com/python-variable/?subject=%5BShared%20Post%5D%20What%20is%20Python%20Variable&body=https%3A%2F%2Ftechnotaught.com%2Fpython-variable%2F&share=email)
 * [  Reddit ](https://technotaught.com/python-variable/?share=reddit)
 * [  Tumblr ](https://technotaught.com/python-variable/?share=tumblr)
 * [  Pinterest ](https://technotaught.com/python-variable/?share=pinterest)
 * [  Telegram ](https://technotaught.com/python-variable/?share=telegram)
 * [  Print ](https://technotaught.com/python-variable/#print?share=print)

### _Related_
