January 2019
Beginner
318 pages
8h 23m
English
In Python, variables don't need to be declared explicitly to reserve memory space. So, the declaration is done automatically whenever you assign a value to the variable. In Python, the equal sign = is used to assign values to variables.
Consider the following example:
#!/usr/bin/python3name = 'John'age = 25address = 'USA'percentage = 85.5print(name)print(age)print(address)print(percentage)Output:John25USA85.5
In the preceding example, we assigned John to the name variable, 25 to the age variable, USA to the address variable, and 85.5 to the percentage variable.
We don't have to declare them first as we do in other languages. So, looking at the value interpreter will get the type of that variable. ...
Read now
Unlock full access