What is Python’s response to the command: type(123)
Select one:
a. <class 'float'>
b. <class 'bool'>
c. SyntaxError: invalid syntax
d. <class 'int'>
e. <class 'str'>
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text ">>>" called?
Select one:
a. a function
b. an operator
c. a prompt
d. a statement
e. a value
Which one of the following words best describes formal languages?
Select one:
a. ambiguity
b. literalness
c. poetry
d. prose
e. redundancy
Feedback
Your answer is incorrect.
The correct answer is: literalness
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text "print(2 + 2)" called?
Select one:
,a. a function
b. an operator
c. a prompt
d. a statement
e. a value
Which one of the following Python expressions computes the number of miles in 5 km, where
one mile is 1.61 km?
Select one:
a. 5 * 1.61
b. .61
c. 1.
d. 1.61 + 5
e. miles = "5 km"
What is python’s response to the command: type("0.123")
Select one:
a. <class 'float'>
b. <class 'bool'>
c. SyntaxError: invalid syntax
d. <class 'int'>
e. <class 'str'>
Which one of the following Python expressions computes the total number of seconds in 21
minutes and 21 seconds?
Select one:
a. 21 + 21
b. 21 + 60
c. "21 minutes" + "21 seconds"
d. 21 * 60 + 21
e. seconds = 21 + "21 minutes"
string is a Python type that represents sequences of numeric values.
Select one:
True
False
What does the Python interpreter output for the following input?
,>>> 1,234.567,890
Select one:
a. 1234
b. 1234.6
c. 1234.56789
d. (1, 234.567, 890)
e. SyntaxError: invalid token
True or False: Learning to debug can be frustrating, but it is a valuable skill that is useful for
many activities beyond programming.
Select one:
True
False
Which of the following is not a valid Python numeric literal:
Select one:
a. 123
b. 0123
c. 0.00
d. 12.3
e. 0.75
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text "+" called?
Select one:
a. a function
b. an operator
c. a prompt
d. a statement
, e. a value
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text "4" called?
Select one:
a. a function
b. an operator
c. a prompt
d. a statement
e. a value
Which one of the following Python expressions has the value 64?
Select one:
a. 8 ^ 2
b. 8 ** 2
c. 8 +- 2
d. 8 += 2
e. 8 -+ 2
What is Python’s response to the command: type(0.123)
Select one:
a. <class 'float'>
b. <class 'bool'>
c. SyntaxError: invalid syntax
d. <class 'int'>
e. <class 'str'>
Match concepts with their definition!