walrus and f.readline example

This commit is contained in:
Mert Gör ☭ 2023-08-24 12:07:36 +03:00
parent ba439fc907
commit 453e277292
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
1 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1,3 @@
with open('sample.py', 'r') as f:
while (s := f.readline()) != '':
print(s, end='')