Michael Jardine
Test por , creado hace más de 1 año

Week 02: Variables, Expressions Lecture 04: Expressions and command-line arguments - Using the command-line: getting information in to your program - Expressions: how to do calculations

4
0
0
Michael Jardine
Creado por Michael Jardine hace alrededor de 6 años
Cerrar

INFO L04 (w02-2) - Expressions and command-line Arguments

Pregunta 1 de 5

1

If trying to import a command-line argument when none was entered ("something = sys.argv[1]"), the error produced will be:

Selecciona una de las siguientes respuestas posibles:

  • NameError

  • SyntaxError

  • IndexError

Explicación

Pregunta 2 de 5

1

If trying to import a command-line argument when "import sys" hasn't been entered, the error produced will be:

Selecciona una de las siguientes respuestas posibles:

  • NameError

  • SyntaxError

  • IndexError

Explicación

Pregunta 3 de 5

1

When running “python3 working.py 12.8”, sys.argv[1] is which of the following?

Selecciona una de las siguientes respuestas posibles:

  • "12.8"

  • "working.py"

  • 12.8

Explicación

Pregunta 4 de 5

1

What will be the output of the following code: x = 3 y = x x = 5 print(y)

Selecciona una de las siguientes respuestas posibles:

  • 3

  • 5

  • an Error of some sort

  • y

Explicación

Pregunta 5 de 5

1

What will be the output of the following code: x = 3 y = x x = 5 print('y')

Selecciona una de las siguientes respuestas posibles:

  • 3

  • 5

  • An Error of some sort

  • y

Explicación