diff --git a/slices.go b/slices.go new file mode 100644 index 0000000..4e09043 --- /dev/null +++ b/slices.go @@ -0,0 +1,7 @@ +package main +import "fmt" +func main() { + sliceNum := []int { 5,4,3,2,1 } + fmt.Println( sliceNum[2:] ); // get the value of slice starting from index 2 + fmt.Println( sliceNum[:3] ); // get the value of slice starting from 0 index upto index 3 +} \ No newline at end of file