def main():
f = open('yahoo.txt', 'w')
f.write('yahoo\n')
f.write('google\n')
f.write('bing\n')
f.write('duckduck\n')
f.write('aol\n')
f.close()
f = open('yahoo.txt', 'r')
print('f.read ', f.read() )
print('f.read(5)', f.read(5)) # just 'f.read(4)' being printed
main()
in the second last line print('f.read(5)', f.read(5))
just string 'f.read(5)'
string is printed and nothing is being printed for the other print argument.
I expect the out to be
f.read(5) yahoo
Any help is appreciated . thanks