last lab
This commit is contained in:
11
labPython/lab3/TextFile8.py
Executable file
11
labPython/lab3/TextFile8.py
Executable file
@@ -0,0 +1,11 @@
|
||||
with open("d.txt", "r") as file:
|
||||
maxX = 0
|
||||
minX = int(file.readline().replace("\n", ""))
|
||||
for x in file:
|
||||
x = int(x.replace("\n", ""))
|
||||
if maxX < x:
|
||||
maxX = x
|
||||
if minX > x:
|
||||
minX = x
|
||||
|
||||
print(f"max: {maxX}, min: {minX}, calculate: {maxX - minX}")
|
||||
Reference in New Issue
Block a user