QuiztudyPREMIUM
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 AnswerB
import sysC
echo $PATHD
wc variables.pyQUESTION 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 AnswerB
envC
inputD
wcQUESTION 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
STDOUTB
STDERRC
STDINCorrect AnswerD
SYSQUESTION 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 AnswerQUESTION 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 AnswerB
raw_input performs basic math operations.C
raw_input gets a string from the user.Correct AnswerD
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 AnswerQUESTION 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
STDINB
STDOUTC
STDERRCorrect AnswerD
PRINTQUESTION 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/sbinB
/usr/sbin/tempCorrect AnswerC
/binD
/sbinQUESTION 9 OF 9
Where are the command line arguments stored? Nice job! The list of arguments are stored in the sys module.
A
argvB
sysCorrect AnswerC
parameters.pyD
printReady 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.
A
echo $?
B
import sys
C
echo $PATH
D
wc variables.py
How confident are you in this answer?