Question: Jump to level 1 A file's name is read from input. The file is opened and cap _ file is assigned with the file object.
Jump to level
A file's name is read from input. The file is opened and capfile is assigned with the file object. Each line in capfile contains a name and a color, representing a customer's name and the color of the cap bought by the customer. Read capfile's contents as a list of strings, where each string is a line in cap.file, and complete the assignment of capdata with the list read.
Click here for example
Ex: If the input is dat a and:
Contents of file datatxt
Mel brown
Eli orange
Mai red
then the output is:
tabledatatxt datatxtdatatxtdatatxtdatatxt
capfile input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
