WELL ELABORATED
SOLUTIONS.
Which of the following are NOT valid variable names? Please select all that apply.
_variable 12th_man x_0 area_of_the_circle
My_Number
ENGR-102-is-tons-of-fun - ANSWER 12th_man
ENGR-102-is-tons-of-fun
Which of the following results in a Boolean value of False for variable x? Please select all that
apply.
x = bool('False')
a = 50
x = a % 2 == 1
a=5b
= 10
x=b>a
a = False
b = True
c = False
,x = (a and b) or (c and not a) and (b or not c) - ANSWER a = 50 x
= a % 2 == 1
a = False
b = True
c = False
x = (a and b) or (c and not a) and (b or not c)
Select the correct order of operation for the relational and Boolean operators shown below. 1 is
the first and 4 is the last.
or
not
and
>= - ANSWER > =
not
and
or
a=4
b=3
if b > a:
print("One")
elif a + b > 10:
print("Two")
elif a % b == 1:
print("Three")
elif a // b == 1:
print("Four")
if a > 4 and b < 3:
print("Five")
else: print("Six")print("Seven") - ANSWER Thre e
Six
Seven
, How many iterations will the following loop execute?
x=1
while x <= 10:
print(x)
x += 3 - ANSWER 4
x=2
y = 'A'
for i in range(10):
x *= 2
y += y
if x > 6:
break
print(f"{x}{y}") - ANSWER 8AAAA
x=4
y=4
z=x*y
z -= 2
print(z) - ANSWER 1 4
print( ( (3 ** 3) + 2 * 3) * (sqrt(25) // 3) + (22 % 4) ) - ANSWER 35
Starting with the following code, write one line of code that prints the value of (square root of 2)
to the screen. This problem is manually graded. - ANSWER print(sqrt(2))
Which of the following are valid variable names in python? Mark all that apply.
shear-
stress
Distance
1st division
_mass - ANSWER Distance
_mass