Q15Comprehension2 Marks18 Dec 2025
Passage
You are inside the lift of a building. There are 8 levels in the building: . The number 0 is the ground floor. Positive numbers correspond to floors above the ground floor, negative numbers correspond to basement levels below the ground floor.
The lift has only two buttons. The button U will take you one level up and the button D will take you one level down.
You make a sequence of presses. `# presses contains the sequence of button presses made by you`
```
presses = 'UDDUUUDDUDU'
floor = 0
index = 0
while index < len(presses):
char = presses[index]
if char == 'U':
floor += 1
elif char == 'D':
floor -= 1
if floor == 2:
print(index + 1)
break
index += 1
```
Based on the above data answer the subsequent questions.
What is the given code snippet printing?