Skip to content

Commit d30e019

Browse files
committed
Add bytearray basic tests.
1 parent 09ce059 commit d30e019

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/basics/bytearray1.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
a = bytearray([1, 2, 200])
2+
print(a[0], a[2])
3+
print(a[-1])
4+
a[2] = 255
5+
print(a[-1])
6+
a.append(10)
7+
print(len(a))
8+
9+
s = 0
10+
for i in a:
11+
s += i
12+
print(s)

0 commit comments

Comments
 (0)