Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do I approach this question? How do I open the file and find the smallest and largest number? Define the get_biggest_difference( filename) function which

how do I approach this question? How do I open the file and find the smallest and largest number?

image text in transcribed
Define the get_biggest_difference( filename) function which is passed a string as a parameter: the name of the file to be read. The file contains integers each separated by white space. The function reads the information from the file and returns the absolute value of the difference between the largest number and the smallest number in the file. For example, if filename refers to the following file: . . . Lab07Q03_1.txt - Edited 14 15 18 18 19 11 15 13 the value 8 is returned by the function (the difference between 11 and 19). For example: Test Result filename = "Lab07003_1. txt" 8 print (get_biggest_difference ( filename) ) filename = "Lab07Q03_2. txt" 15 print (get_biggest_difference( filename) )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions