Question: How would you read an amount to be added to a total from a text file referenced by a file object salesfile assuming amounts are

How would you read an amount to be added to a total from a text file referenced by a file object salesfile assuming amounts are on separate lines in the file and the file has other data?

amount = salesfile.input().rstrip()

amount = float((salesfile.readline()).rstrip())

amount = float(salesfile.read())

amount = salesfile.read()

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!