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
for i in range (1,3): print("*", end="") else: print("*") Answer is ***
The correct answer is A. The snippet returns ***.
It only works the for loop, the else part is no needed in this case because you didn't have any way to take.
range Starts at 1 and ends at 2
A is correct
A is correct...It will print ***
one line and 3 stars
Answer is one line
The * will print in one line
answer is D
Answer is B
Only one line ...
Stop Lying. IT DOES NOT PRINT 1, IT PRINTS THREE BC OF ELSE STATEMENT> TRIED AND TESTED
Three lines, elseincluded