def sum_divisors(n): sum = 0 # Return the sum of all divisors of n, not including n return sum print(sum_divisors(0)) # 0 print(sum_divisors(3)) # Should sum of 1 # 1 print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18 # 55 print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51 # 114
I need help to solve this task using while statement
I need help to solve this task using while statement
|
|
Messages In This Thread |
I need help to solve this task using while statement - by rico4pepe - Mar-11-2020, 03:23 PM
RE: I need help to solve this task using while statement - by micseydel - Mar-11-2020, 03:26 PM
RE: I need help to solve this task using while statement - by ibreeden - Mar-11-2020, 06:45 PM
RE: I need help to solve this task using while statement - by Pranav - Mar-18-2020, 07:17 AM
RE: I need help to solve this task using while statement - by pyzyx3qwerty - Mar-18-2020, 11:12 AM
RE: I need help to solve this task using while statement - by Jaikanth - Apr-01-2020, 08:38 PM
RE: I need help to solve this task using while statement - by pyzyx3qwerty - Apr-02-2020, 11:34 AM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Stuck with using lists to solve task | gery576 | 9 | 949 |
Jan-16-2024, 06:29 PM Last Post: DPaul |
|
How to solve this task? | DERO | 2 | 1,843 |
Dec-06-2021, 07:15 PM Last Post: BashBedlam |
Users browsing this thread: 2 Guest(s)