Computer Science, asked by GaurikaM, 9 months ago

Rewrite the following code fragments using for loop:
(a) while num > 0 :
print(num % 10)
num = num/10
(b) i = 100
while (1 > 0):
print(i)
i=3​

Answers

Answered by bktbunu
1

Explanation:

(a)

for i in range(len(str(num))):

print(num%10)

num = num//10

if num==0:

break

(b) this code is not complete. send me the correct code. I will give you the answer.

Similar questions