summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/bytearray1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/bytearray1.py')
-rw-r--r--tests/basics/bytearray1.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/bytearray1.py b/tests/basics/bytearray1.py
new file mode 100644
index 0000000000..3658713fa8
--- /dev/null
+++ b/tests/basics/bytearray1.py
@@ -0,0 +1,12 @@
+a = bytearray([1, 2, 200])
+print(a[0], a[2])
+print(a[-1])
+a[2] = 255
+print(a[-1])
+a.append(10)
+print(len(a))
+
+s = 0
+for i in a:
+ s += i
+print(s)