GoConqr has a new look! Let us know what you think.

Quiz

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

Michael Jardine 5 questions

Take the quiz

Questions in this quiz (5)

  1. 1If trying to import a command-line argument when none was entered ("something = sys.argv[1]"), the error produced will be:
    1. ANameError
    2. BSyntaxError
    3. CIndexError
  2. 2If trying to import a command-line argument when "import sys" hasn't been entered, the error produced will be:
    1. ANameError
    2. BSyntaxError
    3. CIndexError
  3. 3When running “python3 working.py 12.8”, sys.argv[1] is which of the following?
    1. A"12.8"
    2. B"working.py"
    3. C12.8
  4. 4What will be the output of the following code: x = 3 y = x x = 5 print(y)
    1. A3
    2. B5
    3. Can Error of some sort
    4. Dy
  5. 5What will be the output of the following code: x = 3 y = x x = 5 print('y')
    1. A3
    2. B5
    3. CAn Error of some sort
    4. Dy

Information

Description
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
Language
English
Views
78
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?