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

Descriçã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
Michael Jardine
Quiz por Michael Jardine, atualizado more than 1 year ago
Michael Jardine
Criado por Michael Jardine quase 6 anos atrás
3
0

Resumo de Recurso

Questão 1

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

Questão 2

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

Questão 3

Questão
When running “python3 working.py 12.8”, sys.argv[1] is which of the following?
Responda
  • "12.8"
  • "working.py"
  • 12.8

Questão 4

Questão
What will be the output of the following code: x = 3 y = x x = 5 print(y)
Responda
  • 3
  • 5
  • an Error of some sort
  • y

Questão 5

Questão
What will be the output of the following code: x = 3 y = x x = 5 print('y')
Responda
  • 3
  • 5
  • An Error of some sort
  • y

Semelhante

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