Browse Source

to01 function added

master
Andrey Prokhorov 1 year ago
parent
commit
36d3799e81
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      sba.py

+ 8
- 1
sba.py View File

@ -42,10 +42,17 @@ class SBA:
def __len__(self):
return self._size
def to01(self):
return "".join([str(self.__getitem__(x)) for x in range(self._size-1, -1, -1)])
if __name__ == "__main__":
s = SBA(16)
print(s[1])
s[1] = 1
print(s[1])
print(len(s))
print(s[16])
try:
print(s[16])
except Exception as e:
print(e)
print(s.to01())

Loading…
Cancel
Save