Question: Using python 1. Write: A program that implements a logbook, recording the visitors to a place of interest and their visit's purpose. This log book

Using python  Using python 1. Write: A program that implements a logbook, recording

1. Write: A program that implements a logbook, recording the visitors to a place of interest and their visit's purpose. This log book could later be read by another program. Implement a function called log that takes one parameter, filename, the name of a file. You may assume the file is in the current working directory of the program. log should prompt the user for their name arid the nature of their visit. log should then append a line to the file named filename in the following format: 1 KNAME OF INDIVIDUAL> Additional requirements e If the user enters empty input, or input that is only whitespace, re-prompt them for valid input before continuing. Your program must not remove previous lines from the file. For example, assume the following is the current contents of a file log.txt: 1 Winston Churchill 1 The Queen is expecting me Running logl'log.txt') results in the following exchange: What is your name?: James Bond hat is the nature of your visit?: To save the Queen The file log.txt should now contain: : Winston Churchill I The Queen is expecting me lames Bond | To save the Queen

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!