python file input output using with code example
Example: file input python
# import fileinput
import fileinput
# Using fileinput.input() method
for line in fileinput.input(files ='gfg.txt'):
print(line)
# import fileinput
import fileinput
# Using fileinput.input() method
for line in fileinput.input(files ='gfg.txt'):
print(line)