Computer Science, asked by vigneshmuthu, 1 day ago

debug the program in python , to get output 1,2,3,4,6,7,8,9,terminates ...but I am getting only terminates in output:
for i in range(1,10):
if(i==5):
continue
print(i)
print("terminates")​

Answers

Answered by Anonymous
1

This is because i is not equal to 5

Try this instead -

i = 1

for i in range(1,10):

   print (i)

   i = i + 1

   if i == 10:

       print("Terminated")

Make sure you fix the indents (I have attached an image for reference)

Attachments:
Similar questions