how to print contents of a file in python code example Example: python print contents of file f = open("file_name.txt", "r") print(f.read()) f.close()