Skip to content

Commit 5214da6

Browse files
committed
add more test
1 parent 16bd78f commit 5214da6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

example.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import SparseMatrix as sm
32

43
# Create main function
@@ -54,6 +53,20 @@ def main():
5453
print("Length of M1:")
5554
print(len(m1))
5655

56+
# Convert the sparse matrix to hash
57+
print("Hash of M1:")
58+
print(hash(m1))
59+
60+
# Cast to bool
61+
print("Bool of M1:")
62+
print(bool(m1))
63+
64+
# Delete an element from the sparse matrix
65+
print("Delete M1[0, 0]:")
66+
del m1[0, 0]
67+
print(m1)
68+
69+
5770
# This is the standard boilerplate that calls the main() function.
5871
if __name__ == "__main__":
5972
# Call the main function

0 commit comments

Comments
 (0)