Google IT Automation with Python Professional Certificate • STUDY MODE
PRACTICE QUIZ
QUESTION 1 OF 28
What will the following command return?
grep "ERROR Tried to add information to closed ticket" syslog.log
A
A duplicate file of syslog with the “Tried to add information to closed ticket” errors removed
B
All the closed tickets in syslog
C
All the ERROR logs in which the system tried to add information to closed ticketCorrect Answer
D
All the ERROR logs in syslog
QUESTION 2 OF 28
You can reverse the order of the sort using the reverse parameter. What type of argument does the reverse parameter take?
A
Operator
B
Sort
C
BooleanCorrect Answer
D
Values
QUESTION 3 OF 28
What is the primary advantage of using regular expressions when writing automation scripts to process a system log and generate reports from log files?
A
Flexible pattern matching for extracting specific data from log entriesCorrect Answer
B
Simplify the process of creating log files
C
Automate the installation of log analysis software
D
Enhance the visual presentation of log data in reports
QUESTION 4 OF 28
While you were working with the log file named syslog.log, what command did you use to view the file?
A
cat file syslog.log
B
grep syslog.log
C
cat syslog.logCorrect Answer
D
search syslog.log
QUESTION 5 OF 28
What would you expect the command grep "ERROR Ticket doesn't exist" syslog.log to return?
A
All ERROR logs in syslog.log with the error message “Ticket doesn't exist"Correct Answer
B
All ERROR logs in syslog.log
C
All logs in syslog.log except the ones with the error message “Ticket doesn't exist"
D
All logs in syslog.log that do not have an existing ticket
QUESTION 6 OF 28
What is the Python module used to perform similar tasks to the Unix command grep for filtering log data?
A
logfilter module
B
re (Regular Expression) moduleCorrect Answer
C
logsearch module
D
grep module
QUESTION 7 OF 28
Evaluate the following problem statement: “I want to create a script to sort files.” What's missing?
A
The problem statement does not specify what the script is supposed to do.
B
The problem statement does not specify the programming language.
C
The problem statement is complete.
D
The problem statement does not specify what files to sort.Correct Answer
QUESTION 8 OF 28
Which of the following commands would convert a csv file named error_message.csv into HTML file named errors.html?
Once you've understood the problem statement, what should be the second step for your coding project?
Right on! You'll want to figure out how to tackle the problem with tools such as the Python Standard Library.
A
Planning
B
Writing the code
C
Researching available toolsCorrect Answer
D
Writing a design document
QUESTION 10 OF 28
Which task can you accomplish by using regular expressions in log analysis?
A
Parsing log entries to extract specific fieldsCorrect Answer
B
Sorting log entries based on timestamps
C
Counting the total number of log entries in a file
D
Converting log data into graphical charts
QUESTION 11 OF 28
Complete the sentence for the following Python regular expression: To match a string stored in a line variable, we use the search() method by defining a_____.
A
span
B
line
C
patternCorrect Answer
D
log
QUESTION 12 OF 28
When sorting this dictionary:
fruit = {"oranges": 3, "apples": 5, "bananas": 7, "peaches": 2}
What will the following line of code return?