Python for beginners file

Python for beginners file
0

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.

Python built in functions

1 Like

Thank you):grinning: