Tuples are list of values. We can call it as an immutable Array. Grouping of Related type of data together is called as Tuples.
Syntax:
A constant declaration using the "let" keyword.followed by a name and the a equals operator for assigning the values.
Example :
let triangle = (90,90,90)
To pull the individual values of Tuple pull and assign them.
Example :
let(a,b,c) = triangle
println(b)
To ignore some values from the Tuple use "-" operator in place of that.
Example :
var(a,_,_) = triangle
print(a)
No comments:
Post a Comment