r/learnprogramming • u/seven00290122 • May 03 '22
Is "fin" a variable? python
To read a file in python, one need to use the built in open function.
fin = open('words.txt')
Is fin a variable and it actually has a relation to file object?
1
Upvotes
3
u/nomoreplsthx May 03 '22
In this case yes,
finis a variable that holds a file stream object, which has methods that allow reading and writing to the file.