We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16bd78f commit 5214da6Copy full SHA for 5214da6
example.py
@@ -1,4 +1,3 @@
1
-import os
2
import SparseMatrix as sm
3
4
# Create main function
@@ -54,6 +53,20 @@ def main():
54
53
print("Length of M1:")
55
print(len(m1))
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
70
# This is the standard boilerplate that calls the main() function.
71
if __name__ == "__main__":
72
# Call the main function
0 commit comments