PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
https://www.sololearn.com/Discuss/3092819
finds-and-displays-the-sum-of-multiples-of-5-from-5-to-n-i-e
'''
# reads from the user the value of an integer number n
intNum = int( input("Enter n ( >0 and muliple of 5 ): ") )
if intNum%5 != 0 or intNum <= 0:
print("\nWrong input")
else:
print("\n"*3)
s=0
while intNum>=5:
print(intNum)
s += intNum
intNum -= 5
print("\nThe Sum : ", s) # displays the sum of multiples of 5 from 5 to n
'''
Input:
20
Output:
20
15
10
5
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run