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

Descripción

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
Michael Jardine
Test por Michael Jardine, actualizado hace más de 1 año
Michael Jardine
Creado por Michael Jardine hace casi 6 años
3
0

Resumen del Recurso

Pregunta 1

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

Pregunta 2

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

Pregunta 3

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

Pregunta 4

Pregunta
What will be the output of the following code: x = 3 y = x x = 5 print(y)
Respuesta
  • 3
  • 5
  • an Error of some sort
  • y

Pregunta 5

Pregunta
What will be the output of the following code: x = 3 y = x x = 5 print('y')
Respuesta
  • 3
  • 5
  • An Error of some sort
  • y
Mostrar resumen completo Ocultar resumen completo

Similar

INFO L03 (w02-1) - Variables and Expressions
Michael Jardine
INFO L02 (w01-2) - Programming basics
Michael Jardine
INFO L06 (w03-2) - Control Flow - WHILE
Michael Jardine
GEGE2001 Quiz 2
Michael Jardine
GEGE2001 Quiz 4
Michael Jardine
GEGE2001 Quiz 1
Michael Jardine
GEGE2001 Quiz 3
Michael Jardine
TDAH (TRASTORNO POR DEFICIT DE ATENCION CON HIPERACTIVIDAD)
leo garavito
Aplicaciones Automatas
Diego Zerkk
Adobe InDesign
Nicole Gentle
Tipos de computadoras por estructura interna y capacidad de procesamiento
hebby.mena403