Python is dynamically typed, no pre-declaration of a variable or its type is necessary. : Variable : Introduction PYTHON TUTORIALS


PYTHON TUTORIALS » Introduction » Variable »

 

Python is dynamically typed, no pre-declaration of a variable or its type is necessary.


# The type and value are initialized on assignment. 
# Assignments are performed using the equal sign.

counter = 0
miles = 1000.0
name = 'Bob'
counter = counter + 1
kilometers = 1.609 * miles
print '%f miles is the same as %f km' % (miles, kilometers)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Introduction
» Variable