6
12
9
3
error
-6.0
1
0.5
2.0
error
0
Which of the following are possible Python variable names?
time_of_day
degree$days
3rd_degree
degree3
DEGREES_OF_FREEDOM
not_good_style_but_is_this_long_name_legal_or_not
1milePerHour
Python names are case sensitive?
true false
AnswerIn Python, depending on the types of its arguments, the * (star) operator may indicate (check all that apply):
integer multiplication
floating point multiplication
string replication
logical and
After the math module has been imported, which of the following may be used to compute the square root of 4?
sqrt(4)
sqrt[4]
math.sqrt(4)
math:sqrt(4)
none of the above
What is the value of variable x after the following:
x = 0
for i in range(4):
x = x + i
What is the value of variable x after the following:
x = 3 x *= 4
If variable a contains an object, which of the following invokes a method named m belonging to a with argument values 3 and 4?
m(a, 3, 4)
a.m(3, 2+2)
a.m(3 4)
a[m](3,4)
Which of the following may be used as variable names?
keywords
built-in function names
operators
integers
Assuming the value of the variable x is 4, what is the value of each of the following expressions (enter error if there is a syntax or run-time error)?
1+2 ** 3
9 / 3/1
((2+5) / 4))
round(-5 - 0.6)
20/x ** (2)
10 / x / 4.0
float(5 / 2)
2/4 x
x % 2