Skip to main content

How to declare a variable in python? Variable in python|

Welcome back to the course of Python.

In previous blog we knew how to print anything in python. In this blog we are going to talk about Variable in python.

What is variable in python? 

Variables are like storehouse of the data we want to use for our program. When we add some value in a variable python saves it and it can be use in program.

Now the question is how we store anything in variable?
The answer is very simple firts we call a variable name and then give some value to them.
for example
a = "Python"
b = 120
And so on

Python have 5 types of variable.
  • String
  • Number
  • List
  • Tuple
  • Dictionary
But for now we are just going to focus on Numbers and string.

Here's a video how to declare a variable in python.


Follow me for full course and follow me on Instagram and ask questions 


Give your suggestions in comment box.........

Comments

Popular posts from this blog

How to create a 3d Rubic's cube in python using tkinter

 In this blog post, I will show you how to create a 3d rubic's cube in python using tkinter, a standard GUI library for python. Tkinter provides various widgets and methods to create graphical user interfaces. A 3d rubic's cube is a popular puzzle game that consists of a cube with six faces, each divided into nine smaller squares of different colors. The goal is to rotate the faces of the cube until each face has only one color. To create a 3d rubic's cube in python using tkinter, we will need to use the following steps: 1. Import the tkinter module and create a root window. 2. Create a canvas widget to draw the cube on. 3. Define the coordinates and colors of the vertices and faces of the cube. 4. Define a function to draw the cube on the canvas using polygons. 5. Define a function to rotate the cube along the x, y or z axis using matrix multiplication. 6. Define a function to handle keyboard events and call the rotation function accordingly. 7. Bind the keyboard events to...