Is there any difference between these 2 codes?
1.fhand = open(‘mbox-short.txt’)
inp = fhand.read()
2.fhand = open(‘mbox-short.txt’,“r”)
Is there any difference between these 2 codes?
1.fhand = open(‘mbox-short.txt’)
inp = fhand.read()
2.fhand = open(‘mbox-short.txt’,“r”)
There is no difference between the two lines functionally, they do the same thing. ‘r’ is read only mode and is the default assumed when you run the open function.
Thank you)