File reading and writing Flashcards
1
Q
How to open a file and print its contents
A
with open(‘testing.txt.txt’) as file:
print(file.read())
2
Q
how to check if file is closed
A
print(file.closed)
3
Q
what are the different modes
A
‘r’ for reading
‘w’ for writing
‘a’ for appending
4
Q
A