Question: Python A value which is not an actual input but serves as a signal for termination of an input loop is called a ______. sentinel
Python
A value which is not an actual input but serves as a signal for termination of an input loop is called a ______.
sentinel
terminator
door-stopper
bogey
How many times is the print statement executed? for i in range(10): for j in range(10): print(i * j)
100
20
10
24
The ____ comparison operator is used for equality.
=
==
=!
!=
What type of operator is <= operator?
| Lexicographic | ||
| Arithmetic | ||
| Inequality | ||
| Relational
|
What is the output for y?
y = 0 for i in range(0, 10, 2): y += i
print(y)
| 9 | ||
| 10 | ||
| 11 | ||
| 20
|
You can join two or more strings to form a new string using the concatenation operator ____.
| + | ||
| -> | ||
| <-> | ||
| * |
.
What values could x hold. ? x = randint(3, 12)
| 3 <= x <= 12 | ||
| 3 <= x < 11 | ||
| 4 < x < 11 | ||
| 3 < x <= 12 |
The ____ argument of Python's range function specifies a step value.
| first | ||
| second | ||
| third | ||
| fourth |
What symbol is used to find remainder of division?
| // | ||
| / | ||
| % | ||
| # |
Consider this code. the variable named total in is called _____.
for x in range(7): total = total + 3
| a locator | ||
| a sentinel | ||
| an accumulator | ||
| a capacitor |
What makes this expression 'short-circuit'?
if x > 0 and y < 8:
| x = 0 | ||
| y = 5 | ||
| x = 5 | ||
| y = 14 |
To add a data item to the end of a list you use the append() method.
True
False
"The ____ data type consists of only two data values, true and false."
| digital | ||
| binary | ||
| logical | ||
| Boolean |
Programmers create a ____ to save a value for later use.
| number | ||
| character | ||
| variable | ||
| boolean |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
