Computer Science
Rewrite following code fragment using while loops :
for i in range(1, 16) :
if i % 3 == 0 :
print (i)
Related Questions
Rewrite the following code fragment using for loop:
while num > 0 : count += 1 sum += num num –= 2 if count == 10 : print (sum/float(count)) break
Rewrite following code fragment using while loops :
min = 0 max = num if num < 0 : min = num max = 0 # compute sum of integers # from min to max for i in range(min, max + 1): sum += i
Rewrite following code fragment using while loops :
for i in range(4) : for j in range(5): if i + 1 == j or j + 1 == 4 : print ("+", end = ' ') else : print ("o", end = ' ') print()
Predict the output of the following code fragments:
count = 0 while count < 10: print ("Hello") count += 1