Question: A file's name is read from input. The file is opened and kiwi _ file is assigned with the file object. Each line in kiwi

A file's name is read from input. The file is opened and kiwi_file is assigned with the file object. Each line in kiwi_file contains an integer representing the number of kiwis eaten in a day. Use a loop to read each line of kiwi_file. Inside the loop, subtract each integer in kiwi_file from kiwi_remaining.
kiwi_remaining =30
print(f'Total kiwis: {kiwi_remaining}')
kiwi_file = open(input())

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 Programming Questions!