Week 4 – Managing Data and Processes

using python to interact with the operating system week 4 answers

Practice Quiz: Data Streams

1. Which command will print out the exit value of a script that just ran successfully?

  • wc variables.py
  • echo $?
  • echo $PATH
  • import sys

2. Which command will create a new environment variable?

  • export
  • env
  • input
  • wc

3. Which I/O stream are we using when we use the input function to accept user input in a Python script?

  • STDOUT
  • STDERR
  • STDIN
  • SYS

4. What is the meaning of an exit code of 0?

  • The program ended with an unspecified error.
  • The program ended with a ValueError.
  • The program ended with a TypeError.
  • The program ended successfully.

5. Which statements are true about input and raw_input in Python 2? (select all that apply)

  • input performs basic math operations.
  • raw_input performs basic math operations.
  • raw_input gets a string from the user.
  • input  gets a string from the user.

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply