If a is (1,2,3)

(a) What is the difference (if any) between a3 and (a,a,a) ?
(b) Is a3 equivalent to a + a + a
(c) What is the meaning of a 1:1
(d) what is the difference between a[1:1] and [1:2]

 (a)
a*3 replicate a three times  as
(1,2,3,1,2,3,1,2,3)
and (a,a,a) repeat a thrice as
 ((1,2,3),(1,2,3),(1,2,3)) 

(b)
 Yes, both are same. 

(c)
 it is called slicing of tuple however it will not extract any element and returns a blank tuple as (). 

(d)
Both are example of slicing a tuple. 
the difference between these two is that a[1:2] will return a tuple with 2nd element only as (2,) 
and a[1:1] will return blank tuple as () 
error: Content is protected !!