filmov
tv
write a python program for find sum of odd factors of a number

Показать описание
Code - pls like share and subscribe to channel
=================================================
n = int(input("Enter Number : "))
total = 0
for index in range(1, n+1):
if n % index == 0 and index % 2 == 1:
total += index
print(f"sum of odd factors of a {n} is : {total}")
=================================================
n = int(input("Enter Number : "))
total = 0
for index in range(1, n+1):
if n % index == 0 and index % 2 == 1:
total += index
print(f"sum of odd factors of a {n} is : {total}")