What is the output of the following code?
for i in range(10, 15, 1):
print(i, end='.)
10, 11, 12, 13, 14,
10, 11, 12, 13, 14, 15,
10, 11, 12, 13, 14
10, 11, 12, 13, 14, 15
Answers
Answered by
4
Answer:
(C)10,11,12,13,14
Explanation:
range function take n-1 value entered as the end value
●range(start,stop,step)
Answered by
0
Answer:
Option C : 10,11,12,13,14
Explanation:
The correct code is
for i in range(10, 15, 1):
print(i, end=',')
For the given code,
output will be : 10,11,12,13,14
Reason :
- The above code is an example of range function in python.
- The syntax for range function in python is
for xyz in range(start, stop, step):
Here,
- xyz is a variable for range.
- Start is the starting number of range,
- Stop is the ending number + 1 of range,
- And step is difference between each number in range.
Range function in python.
- The range() function in python is used to print the sequence of numbers between the given range.
- The range function in python is mostly used in while loops to iterate sequences.
#SPJ3
Similar questions