Created
May 16, 2020 20:29
-
-
Save aniruddha27/9a985e013a02c8c0a2b48295ff632bc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = "Greetings.txt" | |
# generator expression | |
lines = (line for line in open(file)) | |
print(lines) | |
# print lines | |
print(next(lines)) | |
print(next(lines)) | |
print(next(lines)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment