Quiz
INFO L04 (w02-2) - Expressions and command-line Arguments
Questions in this quiz (5)
1If trying to import a command-line argument when none was entered ("something = sys.argv[1]"), the error produced will be:
- ANameError
- BSyntaxError
- CIndexError
2If trying to import a command-line argument when "import sys" hasn't been entered, the error produced will be:
- ANameError
- BSyntaxError
- CIndexError
3When running “python3 working.py 12.8”, sys.argv[1] is which of the following?
- A"12.8"
- B"working.py"
- C12.8
4What will be the output of the following code: x = 3 y = x x = 5 print(y)
- A3
- B5
- Can Error of some sort
- Dy
5What will be the output of the following code: x = 3 y = x x = 5 print('y')
- A3
- B5
- CAn Error of some sort
- 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
- Author
- Michael Jardine
- Language
- English
- Views
- 78
- Tags
- Rating
- No ratings yet Rate this quiz