3. Variables, Dynamic Typing, Dynamic binding
Variables:
A variable in Python is defined through assignment. Assign values to variables using ' = '.
name = 'person1'
age = 30
print ('name :', name)
print ('age :', age)
O/p:
name : person1
age : 30
Dynamic Typing:
No need to declare variable type, value that a variable points to has a type, the variable has no type.
Dynamic Binding or Late Binding
When compiler is not able to resolve the call/binding at compile time, such binding is known as Dynamic or late Binding. The type of object is determined at the run time so this is known as dynamic binding.Strong Typing:
Example:
'Python ' + str(3.7)
No comments:
Post a Comment