Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Hi, I am trying to print number in the loop but its saying invalid syntax for last for loop. Please debug it. packages = (6,9,20) n in range (56,66) T = [] i =0 for i in range(1,100): for x in range(1,100): for y in range(1,100): for z in range(1,100): if n== a*x+b*y+c*z: T.append(n) for len(T) >0: print T[i] i=i+1

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
n in range(56,66) what is n ? what is a b c? not defined
def diophantine1(): a=raw_input("write a: ") b=raw_input("write b: ") c=raw_input("write c: ") package=[a,b,c] for n in range(200,0,-1): cont=0 for i in range(0,10): for j in range(0,10): for k in range(0,10): p=((int(package[0]))*i)+((int(package[1]))*j)+((int(package[2]))*k) if p==n: cont+=1 if cont==0: print ("the largest number of McNuggets that cannot be bought in exact quantity is:" + str(n)) break
Hi lopus, Thanks for ur time! import this packages = (6,9,20) n in range (56,66) T = [] i =0 for i in range(1,100): for x in range(1,100): for y in range(1,100): for z in range(1,100): if n== packages[0]*x+packages[1]*y+packages[2]*z: T.append(n) #for len(T) >0: #print T[i] #i=i+1 for num in T: print num I want the combination of 3 numbers please explain the below line in your code for n in range(200,0,-1): And also i want to know if there is syntax error in below line for num in T: print num

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

[200,199,198,197.....] (200,0,-1) start in 200 finish 0 decrees in -1
man n is bad defined

Not the answer you are looking for?

Search for more explanations.

Ask your own question