Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 57b6cf9

Browse files
committed
FEAT Implemented function to print the formatted contents of a boolean array
1 parent b66907a commit 57b6cf9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎main.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,37 @@ def to_binary_string(n: int) -> str:
2020
# ---------------------------------------------------------------------------------------------------------
2121

2222

23+
def print_two_dm_boolean_array(the_array: [[bool]]) -> None:
24+
for row in the_array:
25+
for col in row:
26+
if col:
27+
print("* ", end="")
28+
29+
else:
30+
print(" ", end="")
31+
32+
print()
33+
34+
35+
# ---------------------------------------------------------------------------------------------------------
36+
37+
2338
def main():
2439
"""For testing"""
2540
test_x: float = 0.1
2641
test_y: float = 0.5
2742

43+
test_two_dm_boolean_array = [
44+
[True, False],
45+
[False, True],
46+
[True, False]
47+
]
48+
2849
print(is_between_zero_and_one(test_x, test_y))
2950
print(to_binary_string(8))
51+
print()
52+
53+
print_two_dm_boolean_array(test_two_dm_boolean_array)
3054

3155

3256
# ---------------------------------------------------------------------------------------------------------

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /