Answered step by step
Verified Expert Solution
Question
1 Approved Answer
12345 def status_logger (log_filename, new message): [Select] current time (1) (2) str(datetime.now()) Imagine you're writing a function to allow your program to log status updates
12345 def status_logger (log_filename, new message): [Select] current time (1) (2) str(datetime.now()) Imagine you're writing a function to allow your program to log status updates to some external file. When called, the function would open the log file (whose filename is given by log_filename, then add a new line to the end of the file. The new line should have the current time followed by the log message (represented by new_message, separated by a tab. You may assume that current_time holds the string representing the current time once line 2 is called. Which of the following lines could fill in (1) above? You may assume all indentation is correct. [Select] log_file.close() Which of the following lines could fill in (2) above? You may assume all indentation is correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started