Convert the following for loop into while loop:
for k in range(10,20,5) :
print (k).
Share
Convert the following for loop into while loop:
for k in range(10,20,5) :
print (k).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Explanation:
for k in range(1,20,5):
print(k)
k=k+1
A for loop is a programming technique that allows you to repeat a sequence of events. As soon as a condition is true, we can execute a collection of comments in the while loop.
In For loop :
for k in range(10,20,5) :
print (k).
In while loop:
i=10
while i<=20:
i=i+5
print(i)
i=i+1