Lecture 3
This commit is contained in:
@@ -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