Computer Science, asked by pardeepikaur, 5 months ago

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 vinodkumar05021979
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 SamikshaDhere
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,

  1. xyz is a variable for range.
  2. Start is the starting number of range,
  3. Stop is the ending number + 1 of range,
  4. 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