sscasc@tumkur outputexamplewith access mode 'afile_input open("motivation txt",' 'file_input write("opens file for appending data from the end of the file"file_input close(outputreading data after file is opened for reading datayou can use the read(method to read specified number of characters or all characters from the file and return them as stringthe readline(method to read the next lineand the readlines(method to read all the lines into list of strings example to read data def main()#open file for input infile open("motivation txt"" "print("( using read():"print(infile read())#read all data infile close(close the input file open file for input infile open("motivation txt"" "print("\ ( using read(number)" =infile read( )#reads character print( infile close(close the input file #open file for input infile open("motivation txt"" "print("\ ( using readline()"line =infile readline()#reads line print(repr(line )infile close(close the input file sp_python programming