Part 4 - For Loops Exercise and Solution
Exercise
Exercise 4: Write a program that displays all the numbers from 1 to 25, that are divisible by 5.
Code
See below the code:
Solution-1:
for i in range(5,30,5):
print(i)
Solution-2:
for i in range (1,26):
if (i % 5 == 0):
print (i)
For more details, please contact me here.