Questions
Conceptual
- What is the resulting value and data type of the following expression?
int("20")
- What is the resulting value and data type of the following expression?
str(2023) + str(2023)
- What is the resulting value of the following expression?
type(9 / len( str(110))
- What is the resulting value of the following expression?
"440" + "20"
- What value of x would cause the following expression to evaluate to
True
?(3 + x) == (55 % 2 ** 4)
- What value does the following expression result in, and what is its type?
2 + 2 / 2 ** (2 * 0)
- Using subscription syntax and concatenation, write an expression that evaluates to
"tar"
using the following string:“Saturday"
. - What data type do expressions with relational operators typically evaluate to?
- What does the following expression evaluate to?
int("10" + "40") > 100 * 2
Solutions
Conceptual Solutions
20
,int
"20232023"
,str
<class 'float'>
(Or justfloat
is sufficient on a quiz.)"44020"
4
4.0
There are two possible answers:
"Saturday"[2] + "Saturday"[1] + "Saturday"[4]
or
"Saturday"[2] + "Saturday"[6] + "Saturday"[4]
bool
True