solved 2025/2026
1 Which type of error prevents the program from run-Syntax
. ning?
2 To create a Python program you can use a text
. editor ,
3. IDLE
Which mathematical operator is used to raise 5 to the **
second power in Python?
4. In a print statement, you can set the end
argu- ment to a space or empty string to
stop the output from advancing to a new
line. input()
5. The function reads a piece of data
that has been entered at the keyboard and
returns that piece of data, as a string, back to OneTwoThree
the program.
6. What is the output of the following
statement? print('One'
'Two' 24.0
'Three')
7. What is the output of the following statement,
given that value1 = 2.0 and value2 = 12?
print(value1 * value2)
8. Which of the following is the correct if clause to deter- if y >= 10
and y <= 50:
mine whether y is in the range 10 through 50,
inclu- sive?
9. Write an if clause to determine whether x is anything
1/
36
, other than 10? if x != 10:
10. if x <10:
y=0
2/
36
, INSY 3300 - FINAL - Multiple choice
Study online at https://quizlet.com/_e7czue
Write an if-else statement that assigns 0 to else:
the vari- able y if the variable x is less than y=
10. Otherwise it should assign 99 to the 99
variable y.
11. Write nested decision structures that perform the fol- if x > 10 and
y < 100:
lowing: if x is greater than 10 and y is less than x > y:
100, display the greater of x and y. print(x) elif y
> x:
print (y)
else:
print( ' both values are the
same')
12. What are logical and relational operators? Logical: and, or, not
Relational :==, <=, >= ,
etc
13. What are the values that the variable num 4 iterations having the
contains through the iterations of the val- ues of 0, 1, 2, 3
following for loop? for num in range(4):
14. What are the values that the variable num 2, 4, 6, 8
contains through the iterations of the
following for loop? for num in range(2, 9,
2):
10, 9, 8, 7,..1
15. What are the values that the variable num
contains through the iterations of the
following for loop? for num in range(10, 1,
-1):
16. How many numbers of loop iterations will both of the 4
3/
36
, following for clauses generate?
for num in
range(4): for num in
range(1, 5):
4/
36