Lecture 3
This commit is contained in:
1 parent
5ec825647c
commit
2790f31141
4 files changed
+1038
-3
No files matched your search
@@ -329,6 +329,12 @@ def read_int_sequence(filename: str) -> AlgoDatArray:
|
||||
a[i].value = l[i]
|
||||
return a
|
||||
|
||||
def write_int_sequence(z: AlgoDatArray, filename: str):
|
||||
with open(filename, "w") as file:
|
||||
for i in range(len(z)):
|
||||
file.write(str(z[i].value)+ '\n')
|
||||
|
||||
|
||||
def read_int_sequence_limited(filename: str, limit: int) -> AlgoDatArray:
|
||||
"""Reads a sequence of integers from a file and returns an AlgoDatArray object."""
|
||||
with open(filename, "r") as file:
|
||||
|
||||
Reference in new issue
Block a user