1
ENGR 102 Midterm Study Guide Questions
with Correct Answers | Updated (100%
Correct Answers)
What characters are allowed when using print statements in Python?
(Pick all that applies) Answer: letters, numbers, and underscores
The basic types of variables in Python are _____________, floating-
point, and string. Answer: integers
Which of the following are valid variable names (pick one)
-Winner!
-2nd_name
-My_Name
-Gig'Em
-Gig-Em Answer: My_Name (does not start with a number or _ and
does not have a !,',-, or space
How do you print a floating-point variable, x_value, in Python?
Answer: print(float(x_value))
Consider the lines of code written in Python. What is the output on
the screen?
© 2025 All rights reserved
,2
x=1
y=2
z=3
z *= y
print(z) Answer: 6
What is the output of the following code?
Hint: Output will be a floating point number
num_x = 3.2
num_y = 2
val_num = num_x//num_y
print(val_num) Answer: 1.0(A float operating another float or integer
always returns a float, if neither are floats, it will return an integer
UNLESS IT IS DIVIDING WHICH WILL ALWAYS OUTPUT A FLOAT)
length_x = 3.2
length_y = 2
area_rect = length_x*length_y
print(area_rect) Answer: 6.4
© 2025 All rights reserved
, 3
What is the output of the following program?
Hint: Output will be a floating point number
num1 = 33
num2 = 55
num3 = float(num1)
print(num3) Answer: 33.0
num_x = 6
num_y = 2
val_num = num_x + num_y
print('val_num') Answer: val_num [note the '' ;)]
print("Testing",1,2,3,sep='...',end="over") Answer: Testing...1...2...3over
Write the python statement to assign your age (an integer value) to
the variable "my_age" ? Answer: my_age = int(input())
What is the value stored in variable X after the following python
statements are executed?
X=2
Y=5
© 2025 All rights reserved
ENGR 102 Midterm Study Guide Questions
with Correct Answers | Updated (100%
Correct Answers)
What characters are allowed when using print statements in Python?
(Pick all that applies) Answer: letters, numbers, and underscores
The basic types of variables in Python are _____________, floating-
point, and string. Answer: integers
Which of the following are valid variable names (pick one)
-Winner!
-2nd_name
-My_Name
-Gig'Em
-Gig-Em Answer: My_Name (does not start with a number or _ and
does not have a !,',-, or space
How do you print a floating-point variable, x_value, in Python?
Answer: print(float(x_value))
Consider the lines of code written in Python. What is the output on
the screen?
© 2025 All rights reserved
,2
x=1
y=2
z=3
z *= y
print(z) Answer: 6
What is the output of the following code?
Hint: Output will be a floating point number
num_x = 3.2
num_y = 2
val_num = num_x//num_y
print(val_num) Answer: 1.0(A float operating another float or integer
always returns a float, if neither are floats, it will return an integer
UNLESS IT IS DIVIDING WHICH WILL ALWAYS OUTPUT A FLOAT)
length_x = 3.2
length_y = 2
area_rect = length_x*length_y
print(area_rect) Answer: 6.4
© 2025 All rights reserved
, 3
What is the output of the following program?
Hint: Output will be a floating point number
num1 = 33
num2 = 55
num3 = float(num1)
print(num3) Answer: 33.0
num_x = 6
num_y = 2
val_num = num_x + num_y
print('val_num') Answer: val_num [note the '' ;)]
print("Testing",1,2,3,sep='...',end="over") Answer: Testing...1...2...3over
Write the python statement to assign your age (an integer value) to
the variable "my_age" ? Answer: my_age = int(input())
What is the value stored in variable X after the following python
statements are executed?
X=2
Y=5
© 2025 All rights reserved