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
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
Chemistry,
12 hours ago
Computer Science,
12 hours ago
Math,
1 day ago
Math,
8 months ago
Social Sciences,
8 months ago
Math,
8 months ago