Constants is the fixed value of a program that may not be changed during the program execution, means we cannot change or modified its value after its definition.
Constant can be a Enumeration/character / String / Float / Integer type .
we have to use let keyword for it
let Name_of_constant = initialize_value
For Example :
let constantA = 95
We have to give type annotation at the time of declaration of a constant
var Name_of_constant : data_Type_here = Optional_initial_value_here
let constant2:Float = 1.44
It can be composed of digits , letter and underscore and upper or lowercase letters.
Rule : Must begin with letter or underscore. Or Never be start with digits.
let _constant1 = "9to5ios” //valid
let con_9to5 = "sample” //valid
let 9to5ios = "sample” //invalid
print("Value of _constant1= \(_constant1) con_9to5 = \(con_9to5)”)
Value of _constant1= 9to5ios con_9to5 = sample