![heyhowdy](/avatars/13750.jpg)
heyhowdy
21.02.2020 •
Engineering
Load the pipe-delimited file P. It is organized with 3 fields on each line: firstname|lastname|birthday. Search for the firstname F and lastname L, replacing the birthday with B. Write the file back out in the same pipe-delimited format.Given Code:# Get the filepath from the command lineimport sysP= sys.argv[1]F= sys.argv[2]L= sys.argv[3]B= sys.argv[4]# ## Our Helper functions:## ## Loads the file at filepath# Returns a 2d array with the data#def load2dArrayFromFile(filepath):# Your code goes here:## Searches the 2d array 'records' for firstname, lastname.# Returns the index of the record or -1 if no record exists#def findIndex(records, firstname, lastname):# Your code goes here:# Sets the birthday of the record at the given index# Returns: nothingdef setBirthday(records, index, newBirthday):# Your code goes here: # Convert the 2d array back into a string# Return the text of the 2d arraydef makeTextFrom2dArray(records):# Your code goes here: # ## Our main code body, where we call our functions.# # # Load our records from the file into a 2d arrayrecords= load2dArrayFromFile(P)# Find out which index, if any, has the name we are huntingindexWeAreHunting= findIndex(records, F, L)# Set the birthday record to the one we were passedsetBirthday(records, indexWeAreHunting, B)# Convert the records into a text stringoutput= makeTextFrom2dArray(records)# Your code goes here# write the text string out to the file
Solved
Show answers
More tips
- L Leisure and Entertainment 10 Ways to Celebrate Your Favorite Holidays: A Guide to Festivities and Traditions...
- S Sport When will the Biathlon World Championships 2011 take place in Khanty-Mansiysk? Answers to frequently asked questions...
- O Other What is a Disk Emulsifier and How Does it Work?...
- F Family and Home What does a newborn need?...
- F Family and Home Choosing the Right Car Seat for Your Child: Tips and Recommendations...
- F Food and Cooking How to Get Reconfirmation of Registration?...
- C Computers and Internet How to Get Rid of Spam in ICQ?...
- A Art and Culture Who Said The Less We Love a Woman, the More She Likes Us ?...
- F Family and Home How to Get Rid of Your Neighbors?...
- S Society and Politics How Could Nobody Know About the Dead Mountaineers?...
Answers on questions: Engineering
- M Mathematics 3x-2y=8 2x+3y=9 4x-2y=6 2x-4y=8 3x+y=5...
- G Geography In a glacier, the ice moves fastest: Group of answer choices At the bed on some glaciers, halfway between the bed and the surface on other glaciers, and at the surface...
- H History How did WWI impact America s reputation?...
- M Mathematics The mean score on the Wechsler IQ test is 100 and the standard deviation is 15. This means that people within one standard deviation of the mean have IQ scores that...
- M Mathematics Find the range of f(x)= 1/3x-2 for the domain {-3,-1,0,6}...
- H History Early European Colonization of America: Teacher Graded Activity...
- M Mathematics If ABC = DEF, what is the length of AB? please help ...
- H Health Whats 50+50=I dare all of you to send me a friend request...
- M Mathematics Choose the correct solution and graph for the inequality -x/3 =6...
- B Business What is the mechanism by which high import tariffs can reduce a country’s trade deficit?a.High import tariffs lead to cheaper imports; leads to higher demand for...
Ответ:
what are the answer choices?
Explanation: