× Python Introduction What is Python Python Features Python History Python Applications Python Install Python Path Python Example Execute Python Keywords Constant Variable Statements & Comments Python I/O and Import Operators UnaryBinaryTernary Unary Operators Unary Minus Binary Operators Arithmetic Operators Assignment Operators Relational Operators Logicaloperators Bitwise Operator Ternary Operators Control Statements in Python conditonal Statements IF if else Else If Nested if Switch For loop Nested For Loop While Loop Nested while Loop Unconditonal Statemets Continue Break Pass FUNCTIONS Python Function Function Argument Python Recursion Anonymous Function Python Modules NATIVE DATATYPES Python List Python Numbers Python Tuple Python String Python Set Python Dictionary OOPS PRINCIPALS Encapsulation Class Variable Method Object Or Instance CreationMethod Calling OOPS Syntax And Explanation DATA ABSTRACTION Constructor Inheritance 1.Single or simple Inheritance 2.Multilevel Inheritance 3.Hierarchical Inheritance 4.Multiple Inheritance 5.Hybrid Inheritance Operator Overloading File Operation Python Directory Python Exception Python - Multithreading Python - Database Access Python - CGI Python - Reg Exp Python - Date Python - XML Processing Python - GUI
  • iconPython Online Training In Andhra Pradesh and Telangana
  • icon9010519704

Opening Hours :7AM to 9PM

Python Constant


Constant:
Constant is an identifier whose value can not be changed.In Python language these constants are classified into following types
1.Numerical constants
2.Character constants

Numerical Constants:
Numerical means numbers .these are classified into 2 types
1.Integer constants
2.Real constants

Integer Constants:
Integer constants means + or - numbers.
Example:
x=10;
y=-10

Real Constants:
Real constants means floating values or decimal values.
Example:
x=10.0;

Character Constants:
These are classified into fallowing types
1.Single character constants
2.String character constants

Single Character Constants:
If any character or symbol or number enclosed with single quotation.
Example:
x='a';
x='2';
x='@';

String Character Constants:
Group of characters or symbols or numbers enclosed with double quotation.
Example:
s1="abc";
s2="@##$";
s3="123";