Post

@PythonPr Answer: B) 1 3
The Python code uses the range(start, stop, step) function. start is 1 (inclusive). stop is 5 (exclusive). step is 2.
The loop starts at (i=1). The next value of (i) is (1+2=3). The next value would be (3+2=5), but this is equal to the stop value, so the loop
English

@PythonPr B 13 is the right answer
Simple use of for loop and range function (start,end,stepsize) here stepsize is given 2 and by default is 1 end is excluded and start is included here so output will be
1,
1+2 = 3
3+2 = 5 but end is excluded so we answer will be 1 3.
English

@PythonPr B) Because it's a loop from 1 to 5, and it moves two steps in between, so we'll take 1 and 3.
English

@PythonPr Syntax error, second line of the code should be indented.
English

@PythonPr b is correct option start stop step 1 3 on 5 its terminates
English

@PythonPr How range(1, 5, 2) works
Start at 1
Stop before 5
Step by 2
So the values of i are: 1 3
English

@PythonPr None of them, because there is an indentation error.
But with fixed indentation it will print option B.
English

@PythonPr B.
Because the range says it starts from 1, goes up to but not including 5, and is every other number (odds). So that would be 1 and 3.
English
























