1
TAMU ENGR 102 (python coding) Questions
with Correct Answers | Updated (100%
Correct Answers)
x += c Answer: x = x + c
a -= 3 Answer: a = a - 3
x *= 4 Answer: x = x * 4
y /= 3 Answer: y = y / 3
what are some different types of variables? Answer: Integers,
Floating-Point, Strings, Booleans
what is an integer? Answer: whole numbers, no decimals/fractions
what are floating-point numbers? Answer: numbers with a decimal
point
what is boolean? Answer: single value either true or false
what are strings? Answer: way of describing text (you can use either
single quotes or double quotes)
float(3) Answer: value becomes 3.0
int(4.9) Answer: has the value 4
© 2025 All rights reserved
, 2
str(10*1.0) Answer: has the value '10.0'
what is the boolean value of true/false? Answer: true is assumed to
have the value 1
false is assumed to have the value 0
x=3
y=4
print(str(x) + ':' + str(y)) Answer: 3:4
how to ask the user for input? Answer: x = float(input())
== Answer: equal to
!= Answer: inequality
a = 10
b = 10
c = 20
d = ((a>b) and (b<=c)) or (not((((c<=a+b) and (a==10)) or ((b==10)
and c!=10))))
print(d) Answer: false
temperature = 100
© 2025 All rights reserved
TAMU ENGR 102 (python coding) Questions
with Correct Answers | Updated (100%
Correct Answers)
x += c Answer: x = x + c
a -= 3 Answer: a = a - 3
x *= 4 Answer: x = x * 4
y /= 3 Answer: y = y / 3
what are some different types of variables? Answer: Integers,
Floating-Point, Strings, Booleans
what is an integer? Answer: whole numbers, no decimals/fractions
what are floating-point numbers? Answer: numbers with a decimal
point
what is boolean? Answer: single value either true or false
what are strings? Answer: way of describing text (you can use either
single quotes or double quotes)
float(3) Answer: value becomes 3.0
int(4.9) Answer: has the value 4
© 2025 All rights reserved
, 2
str(10*1.0) Answer: has the value '10.0'
what is the boolean value of true/false? Answer: true is assumed to
have the value 1
false is assumed to have the value 0
x=3
y=4
print(str(x) + ':' + str(y)) Answer: 3:4
how to ask the user for input? Answer: x = float(input())
== Answer: equal to
!= Answer: inequality
a = 10
b = 10
c = 20
d = ((a>b) and (b<=c)) or (not((((c<=a+b) and (a==10)) or ((b==10)
and c!=10))))
print(d) Answer: false
temperature = 100
© 2025 All rights reserved