From 238aea4a31bdb2bc13f91e60678d01817f8ecc53 Mon Sep 17 00:00:00 2001 From: AbhiBhalo Date: Tue, 1 Oct 2019 07:01:34 +0530 Subject: [PATCH] Added a python program --- array.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 array.py diff --git a/array.py b/array.py new file mode 100644 index 00000000..c188e712 --- /dev/null +++ b/array.py @@ -0,0 +1,7 @@ +import array as arr +numbers_list = [2, 5, 62, 5, 42, 52, 48, 5] +numbers_array = arr.array('i', numbers_list) +print(numbers_array[2:5]) # 3rd to 5th +print(numbers_array[:-5]) # beginning to 4th +print(numbers_array[5:]) # 6th to end +print(numbers_array[:]) # beginning to end