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

Beschreibung

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 von Michael Jardine, aktualisiert more than 1 year ago
Michael Jardine
Erstellt von Michael Jardine vor mehr als 6 Jahre
14
0

Zusammenfassung der Ressource

Frage 1

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

Frage 2

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

Frage 3

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

Frage 4

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

Frage 5

Frage
What will be the output of the following code: x = 3 y = x x = 5 print('y')
Antworten
  • 3
  • 5
  • An Error of some sort
  • y
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

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