Google IT Automation with Python Professional Certificate • STUDY MODE
DATA STREAMS
QUESTION 1 OF 9
Which command will print out the exit value of a script that just ran successfully?
Great work! Echo will print out the exit value (question mark variable) of a script that just ran successfully.
A
echo $?Correct Answer
B
import sys
C
echo $PATH
D
wc variables.py
QUESTION 2 OF 9
Which command will create a new environment variable?
Right on! This command will create a new environment variable, and give it a value.
A
exportCorrect Answer
B
env
C
input
D
wc
QUESTION 3 OF 9
Which I/O stream are we using when we use the input function to accept user input in a Python script?
Awesome! STDIN is the standard I/O stream for input.
A
STDOUT
B
STDERR
C
STDINCorrect Answer
D
SYS
QUESTION 4 OF 9
What is the meaning of an exit code of 0?
Nice job! An exit value of 0 always indicates the program exited without error.
A
The program ended with an unspecified error.
B
The program ended with a ValueError.
C
The program ended with a TypeError.
D
The program ended successfully.Correct Answer
QUESTION 5 OF 9
Which statements are true about input and raw_input in Python 2? (select all that apply)
Excellent! In Python 2, input evaluates the user)s input as an expression.
Nice work! raw_input gets a raw string from the user.
A
input performs basic math operations.Correct Answer
B
raw_input performs basic math operations.
C
raw_input gets a string from the user.Correct Answer
D
input gets a string from the user.
QUESTION 6 OF 9
Which line of code from the seconds.py script will convert all integer inputs into seconds?
Awesome! This line of code uses a function to convert the number of hours, minutes, and seconds into seconds.
A
int(input("Enter the number of seconds: "))
B
int(input("Enter the number of minutes: "))
C
int(input("Enter the number of hours: "))
D
to_seconds(hours, minutes, seconds)Correct Answer
QUESTION 7 OF 9
Which I/O stream is the output function using when showing an error message?
You nailed it! STDERR displays output specifically for error messages.
A
STDIN
B
STDOUT
C
STDERRCorrect Answer
D
PRINT
QUESTION 8 OF 9
Which directory is NOT listed in the PATH variable by default?
Right on! This directory is not listed by default.
A
/usr/local/sbin
B
/usr/sbin/tempCorrect Answer
C
/bin
D
/sbin
QUESTION 9 OF 9
Where are the command line arguments stored?
Nice job! The list of arguments are stored in the sys module.
A
argv
B
sysCorrect Answer
C
parameters.py
D
print
Ready to test your recall?
Which command will print out the exit value of a script that just ran successfully?
Great work! Echo will print out the exit value (question mark variable) of a script that just ran successfully.