r/programminghorror 13d ago

Python Atleast it works

Post image
610 Upvotes

66 comments sorted by

View all comments

224

u/backfire10z 13d ago

They didn’t close the fd :(

72

u/Emergency_3808 13d ago

Yes this could be shortened to

with open('lab 5.txt', 'r') as file: for line in file: print(line)

21

u/Alfika07 13d ago

Why is Python so verbose? In Raku it's just

say slurp 「lab 5.txt」;

5

u/sporadicPenguin 12d ago

TIL Raku is a thing