Python Variables

Python Variables

Variables in Python are reserved memory locations and do not work like variables in Java, or C. They aren’t declared in the same way. You only need to assign a value is to a variable in Python, for declaration and that’s it! In this lesson we will learn about Python Variables.

Here are some examples,

The = is used to assign value to a variable. Here we have 3 variables, va1, val2 and val3,

Let us compare Java with Python for the same example. In Java, you need to follow a lengthy process of using datatype,

Let us now see an example of integer and float assignment in Python,

The following is the output,

Python Variables

In this lesson, we learned how to work with Variables in Python.

First Python Program (Script Mode)
Python Loops
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment