Here are my codes, I expect questions and corrections ps1a and ps1b http://dpaste.com/577717/ ps2 and ps2a http://dpaste.com/577720/
does it work??
Hi jhonny, I didn't get a prime list from your code for ps1a. I would recommend setting an initialization point, e.g. assign top=3 as initial value and build from there.
the codes are tested and work, maybe you no indented tested: prime(3) i dont undestand you
prime does seem to print primes up to top. sum_log doesn't work - http://dpaste.com/579732/ diophantine doesn't work - http://dpaste.com/579740/ diophantine1 works - it prints 43 which i think is correct
in sum_log this is_prime(num): in the code i explained that def is_prime(num): cont=0 j=num while j!=0: if num%j==0: cont=cont+1 j=j-1 if cont==2: return 1 else: return 0
and diophantine(12) you need 2 box of six, the answer is correct 6 9 20 2 0 0
it printed 'no se puede' - i took that to mean that it could not be bought.
Join our real-time social learning platform and learn together with your friends!