find all the errors in the following code and explain what they are and how to c
ID: 3780216 • Letter: F
Question
find all the errors in the following code and explain what they are and how to correct them
CSI 100 Debugging Lab #2 Problem 1: Warmup. Divisibility. It does this by testing every number from 1 to n to see if n is divisible by it. Example, for n=100, the output should be: Type a positive integer: 100 100 is divisible by 1 100 is divisible by 2 100 is divisible by 4 100 is divisible by 5 100 is divisible by 10 100 is divisible by 20 100 is divisible by 25 100 is divisible by 50 100 is divisible by 100 Done. n = int(raw_input("Type a positive integer: ")) for i in range(n): if n/i = 0: print i, 'is divisible by ', n print 'Done.'Explanation / Answer
n = int(raw_input("Type a positive number:"))
for i in range(1,n+1):
if n%i==0:
print n,' is divisible by ',i
print 'Done.'
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.