Skip to content

Commit

Permalink
Update python.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoroste authored Dec 13, 2024
1 parent acd0249 commit ca64800
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ any(lst) # True if any element is true

```py
file = open("hello.txt", "r") # open in read mode 'r'
content = f.read() # Read entire file
lines = f.readlines() # Read all lines as a list
file.close()

# Alternative
Expand Down

0 comments on commit ca64800

Please sign in to comment.