Hello need another expert's advice on how to program this exercise using Python 3. (see image). Sample Inputs and Outputs are given as a guide. My code (see pic) still says it is missing something...


Hello need another expert's advice on how to program this exercise using
Python 3. (see image). Sample Inputs and Outputs
are given as
a guide.


My code (see pic) still says it is missing something when I test the case and is error. Thank you very much, this will really help me learn.


1 while(True):<br>nl=int(input(0 and n2>0 and n1
Extracted text: 1 while(True): nl=int(input("Enter nl: ")); n2=int (input("Enter n2: ")); if(nl>0 and n2>0 and n1
Ask for two user inputs n1 and n2. Keep asking for inputs until the conditions below are satisfied.<br>Both n1 and n2 must be positive integers. n1 should be less than n2.<br>Then print the following:<br>Condition 1: Count all numbers between nl and n2 that are divisible by 7 and not divisible by 3<br>Condition 2: Count all numbers between n1 and n2 that are divisible by 5<br>Condition 3: Count all numbers between n1 and n2 that are divisible by 5 and divisible by 9<br>Sample Input #2<br>Sample Input #1<br>3<br>46<br>Sample Output #1<br>Enter nl: Enter n2: Number of integers that satisfy A from 3 to 46: 4<br>Number of integers that satisfy B from 3 to 46: 9<br>Number of integers that satisfy C from 3 to 46: 1<br>Sample Output #2<br>Enter nl: Enter n2: Invalid input.<br>Enter nl: Enter n2: Invalid input.<br>Enter nl: Enter n2: Number of integers that satisfy A from 1 to 2: 0<br>Number of integers that satisfy B from 1 to 2: o<br>Number of integers that satisfy C from 1 to 2: o<br>

Extracted text: Ask for two user inputs n1 and n2. Keep asking for inputs until the conditions below are satisfied. Both n1 and n2 must be positive integers. n1 should be less than n2. Then print the following: Condition 1: Count all numbers between nl and n2 that are divisible by 7 and not divisible by 3 Condition 2: Count all numbers between n1 and n2 that are divisible by 5 Condition 3: Count all numbers between n1 and n2 that are divisible by 5 and divisible by 9 Sample Input #2 Sample Input #1 3 46 Sample Output #1 Enter nl: Enter n2: Number of integers that satisfy A from 3 to 46: 4 Number of integers that satisfy B from 3 to 46: 9 Number of integers that satisfy C from 3 to 46: 1 Sample Output #2 Enter nl: Enter n2: Invalid input. Enter nl: Enter n2: Invalid input. Enter nl: Enter n2: Number of integers that satisfy A from 1 to 2: 0 Number of integers that satisfy B from 1 to 2: o Number of integers that satisfy C from 1 to 2: o

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here