1
ENGR 102 Exam 1 Questions with Correct
Answers | Updated (100% Correct Answers)
Write the output of the following code:
x=3
y=4
z=x*y
z += 2
print(z) Answer: 14
What is the output of the following code:
print(((2 * 3) + 3 5) * (sqrt(49) // 4) + (23 % 7)) Answer: (8 + 15) (7
// 4) + 2 23 1 + 2 25.0=
26.286
Starting with the following code, write one line of code that prints
the value of 2-√2 (square root of 2) to the screen.
from math import *
# your code goes here Answer: from math import *
print ( sqrt(2) )
© 2025 All rights reserved
, 2
Which of the following are valid variable names in python? Mark all
that apply.
Length
3rdplace
kinetic-energy
Correct! _time Answer: Length
_time
Arrange the following mathematical operators in the correct order
of operations according to python. 1 is the first and 4 is the last.
Answer: ( )
**
%
-
Floating-point numbers have a decimal point
TRUE or FALSE Answer: True
Strings can be defined with single quotes ('') or double quotes ("")
T or F Answer: True
© 2025 All rights reserved
ENGR 102 Exam 1 Questions with Correct
Answers | Updated (100% Correct Answers)
Write the output of the following code:
x=3
y=4
z=x*y
z += 2
print(z) Answer: 14
What is the output of the following code:
print(((2 * 3) + 3 5) * (sqrt(49) // 4) + (23 % 7)) Answer: (8 + 15) (7
// 4) + 2 23 1 + 2 25.0=
26.286
Starting with the following code, write one line of code that prints
the value of 2-√2 (square root of 2) to the screen.
from math import *
# your code goes here Answer: from math import *
print ( sqrt(2) )
© 2025 All rights reserved
, 2
Which of the following are valid variable names in python? Mark all
that apply.
Length
3rdplace
kinetic-energy
Correct! _time Answer: Length
_time
Arrange the following mathematical operators in the correct order
of operations according to python. 1 is the first and 4 is the last.
Answer: ( )
**
%
-
Floating-point numbers have a decimal point
TRUE or FALSE Answer: True
Strings can be defined with single quotes ('') or double quotes ("")
T or F Answer: True
© 2025 All rights reserved