How many lines does the following snippet output?
How many lines does the following snippet output?
The code snippet has a for loop that iterates over the range (1, 3), which means it will run for i=1 and i=2. In each iteration, print('*', end='') will execute, which prints '*' without moving to a new line. After the loop, the else clause will execute, printing '*' and moving to a new line. Therefore, the entire output will be '***' on a single line.
its one line
It prints only in one line
3 stars in one line
The correct answer is A. The snippet returns ***.
for i in range (1,3): print("*", end="") else: print("*") Answer is ***
range Starts at 1 and ends at 2
It only works the for loop, the else part is no needed in this case because you didn't have any way to take.
Three lines, elseincluded
Stop Lying. IT DOES NOT PRINT 1, IT PRINTS THREE BC OF ELSE STATEMENT> TRIED AND TESTED
Only one line ...
Answer is B
answer is D
The * will print in one line
Answer is one line
one line and 3 stars
A is correct...It will print ***
A is correct