A constant is an identifier whose value cannot be changed throughout the execution of a program whereas the variable value keeps on changing.
There are no constants in Python, the way they exist in C and Java.
In Python, It is not possible to define constant whose value can not be changed.
In Python, Constants are usually defined on a module level and written in all capital letters with underscores separating words but remember its value can be changed.
Ex:-
PI
TOTAL
MIN_VALUE
Python Advanced Programming Tutorials and Networking Part 1 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 2 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 3 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 4 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 5 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 6 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 7 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 8 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 9 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 10 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 11 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 12 out 13 — By DevOpsSchool
Python Advanced Programming Tutorials and Networking Part 13 out 13 — By DevOpsSchool
Latest posts by Rajesh Kumar (see all)
- How to Choose Wireless Access Points for Office - December 13, 2024
- Online Real Estate Courses: Navigating the Shift to Digital Education - December 13, 2024
- From Concept to Implementation: IoT Services Redefining Modern Solutions - December 13, 2024