Question: 3. 120 ptsl Write function quote (0 that takes as input the name of a file (as a string) and an index i (as an

 3. 120 ptsl Write function quote (0 that takes as input

3. 120 ptsl Write function quote (0 that takes as input the name of a file (as a string) and an index i (as an integer). The file will contain quotes, one per line. The function should open the file, read the file, close the file, and return the i-th quote (i.e. the i-th line in the file), assuming that the quote numbering starts at 0. Test your solution on file Wilde_ quote file by downloading the file before running. Usage: >>> quote ("Wilde Quotes.txt", 5) 'It is better to be beautiful than to be good, but it is better to be good than to be ugly. ' > quote ("Wilde Quotes.txt", 0) The mystery of love is greater than the mystery of death

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!