Question: Write a program called ' testc.py' that asks the user to enter a series of integer numbers, one per line, finishing with the word 'DONE'.

Write a program called ' testc.py' that asks the user to enter a series of integer numbers, one per line, finishing with the word 'DONE'. The program will count and sum up the number of adjacent pairs of values where the first number is a factor of the second number in the sequence. Say, for example, the user enters the following series of numbers:

3,2,2,1,4,4,6

. There are three pairs of adjacent values that meet the criterion:

(2,2),(1,4)

and

(4,4)

. Their sum is 17 . HINT: Given two integers

a

and

b,a

is a factor of

b

if

b

&

a==0

. Sample 10 (The input from the user is shown in bold font - do not program this):Sample 10 (The input from the user is shown in bold font - do not program this):

Write a program called ' testc.py' that asks the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!