This website works better with JavaScript.
Home
Explore
Help
Sign In
prox
/
SimpleBitArray
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
to01 function added
master
Andrey Prokhorov
1 year ago
parent
aed26d2117
commit
36d3799e81
1 changed files
with
8 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+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
(
)
)
Write
Preview
Loading…
Cancel
Save