open file read file txt code example
Example 1: file.open("file.txt);
myfile = open("example.txt")
txt = myfile.read()
print(txt)
myfile.close()
Example 2: reading text file in python
>>> year = 2016
>>> event = 'Referendum'
>>> f'Results of the {year} {event}'
'Results of the 2016 Referendum'