Michael Jardine
Quiz por , criado more than 1 year ago

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
Criado por Michael Jardine aproximadamente 6 anos atrás
Fechar

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

Questão 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:

Selecione uma das seguintes:

  • NameError

  • SyntaxError

  • IndexError

Explicação

Questão 2 de 5

1

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

Selecione uma das seguintes:

  • NameError

  • SyntaxError

  • IndexError

Explicação

Questão 3 de 5

1

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

Selecione uma das seguintes:

  • "12.8"

  • "working.py"

  • 12.8

Explicação

Questão 4 de 5

1

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

Selecione uma das seguintes:

  • 3

  • 5

  • an Error of some sort

  • y

Explicação

Questão 5 de 5

1

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

Selecione uma das seguintes:

  • 3

  • 5

  • An Error of some sort

  • y

Explicação