InterviewSolution
Saved Bookmarks
| 1. |
What is g(24) - g(23), given the definition of g below? def g(n): s=0 for i in range(1,n+1): if n%i == 0: s = s+1 return(s) |
| Answer» TION:It's basically program to find NUMBER of factors of given value.It will add +1 to counter when any number i DIVIDE given number nfactors of 24 are 1,2,3,4,6,8,12,24factors of 23 are 1,23g(24)-g(23) = 8 - 2 = 6Hope it helps :-) | |