Monday 27 May 2019

Python Constants

Constants in Python:

Defn: A constant is similar to a variable but its value can not be modified or changed in the course of the program execution.
The constant concept is not applicable in Python. It is possible in Java, C++ and C languages.
But A developer can indicate a variable as constant by writing its name in all upper case letters. 
For our convenience, we use uppercase characters. Defining constant is not possible in Python

Example:
In mathematics, 'PI' value is 3.1714 which never changes and it is constant. 

PI=3.1714  #It is just convention but we can change the value.

Youtube channel click here to see this video
Next topic: Operators

1 comment:

Files with Exception handling

#Ask the user to take two input integer values var a,b try:     a=int(input("enter any integer value:"))     b=int(input(&qu...