Lecture 3

This commit is contained in:
Oliver Hofmann
2024-04-22 15:39:10 +02:00
parent 5ec825647c
commit 2790f31141
4 changed files with 1038 additions and 3 deletions
+6
View File
@@ -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: