Python_Institute
PCEP-30-02 · Question #308
How many stars will the following code print to the monitor? ``python x = 1 while x < 10: print('*') x = x << 1 ``
The correct answer is D. eight. See the full explanation below for the reasoning.
Question
How many stars will the following code print to the monitor?
x = 1
while x < 10:
print('*')
x = x << 1
Options
- Atwo
- Bone
- Cfour
- Deight
How the community answered
(58 responses)- A16% (9)
- B3% (2)
- C7% (4)
- D74% (43)
Community Discussion
No community discussion yet for this question.