Rewrite the following code of program using the for loop in python:
a=int(input("Enter a number"))
i=a
while i>=0:
print(a*i)
i=i-2
Answers
Answered by
37
ANSWER:-
a = int(input("Enter a number"))
for i in range(a, - 1, - 2):
print(a*i)
Hope it helps...
Answered by
0
Answer:
Coverting 'while' loop to 'for' loop. Write the following for conversion of 'while' loop to 'for' loop:-
Explanation:
a=int(input("Enter a Number:"))
for i in range(a, -1, -2):
print(a*i)
Similar questions
Chemistry,
5 months ago
Science,
5 months ago
India Languages,
11 months ago
Hindi,
11 months ago
Math,
1 year ago