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:...


Need help programming this using
Python.


There are two user inputs n1 and n2 and three conditions (see image). Thank you programming experts!


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 n1 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>1<br>46<br>1<br>1<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: 0<br>Number of integers that satisfy C from 1 to 2: 0<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 n1 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 1 46 1 1 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: 0 Number of integers that satisfy C from 1 to 2: 0

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here