19.1 LAB: Count multiples Write a program that takes three integers as input: low, high, and x. The program then outputs the number of multiples of x between low and high inclusive. Ex: If the input...



19.1 LAB: Count multiples






Write a program that takes three integers as input: low, high, and x. The program then outputs the number of multiples of x between low and high inclusive.


Ex: If the input is:


1 10 2

the output is:


5

Hint: Use the % operator to determine if a number is a multiple of x. Use a for loop to test each number between low and high.


The code I put here doesn't work. Use Python to help me with this, please.




LAB<br>19.1.1: LAB: Count multiples<br>0/ 10<br>ACTIVITY<br>main.py<br>Load default template..<br>1 x=list(map(int,input().split()))<br>2 count=0<br>3 for i in range (low, high+1):<br>if(i%x==0):<br>4<br>5<br>count += 1<br>6 print(count)<br>

Extracted text: LAB 19.1.1: LAB: Count multiples 0/ 10 ACTIVITY main.py Load default template.. 1 x=list(map(int,input().split())) 2 count=0 3 for i in range (low, high+1): if(i%x==0): 4 5 count += 1 6 print(count)

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here