Constant (स्थिरांक)

Python Constant
Python Constant

एक स्थिरांक (Constant) एक प्रकार का चर(Variable) जिसका मान  बदला नहीं जा सकता है। वास्तव में, हम शायद ही कभी पायथन में स्थिरांक का उपयोग करते हैं। स्थिरांक को आमतौर पर एक अलग मॉड्यूल / फ़ाइल पर घोषित और असाइन किया जाता है।  

Example 
#Declare constants in a separate file called constant.py 
PI = 3.14 
GRAVITY = 9.8

Example 
#inside main.py we import the constants
import constant 
print(constant.PI) 
print(constant.GRAVITY)