Simple program to read file in Python

def main():

f = open("file.txt","r")

if f.mode == ‘r’:

contents = f.read()

print contents

if __name__== "__main__":

main()