Need help in Python 3. I was told there's still a missing code but my output is already the same with my expected output. I was told to exclude n1 in my code. How do I exclude n1 0 and n2>0 and...


Need help in Python 3. I was told there's still a missing code but my output is already the same with my expected output. I was told to exclude n1 in my code. How do I exclude n1


Submitted Code<br>Ask for two user inputs n1 and n2. Keep asking for inputs until conditions below are satisfied.<br>n1 and n2 must be positive integers. n1 should be less than n2.<br>Language: Python 3<br>P Open in editor<br>Then print the following:<br>1 while(True):<br>Condition 1: all numbers bet. nl and n2 that are divisible by 7 and not divisible by 3<br>Condition 2: all numbers bet. n1 and n2 that are divisible by 5<br>nl=int (input(0 and n2>0 and n2>nl): break; print("Invalid input."); 2 3 4 Condition 3: all numbers bet. n1 and n2 that are divisible by 5 and divisible by 9 5 Sample Input #2 7 #initialize variables 8 countl,count2, count3=0,0,0; 9 for n in range (nl,n2): if(n%7==0 and n%3!=0): countl += 1 12 for n in range (nl,n2): if(n%5==0): Sample Input #1 1 1 10 46 11 1 1 13 Sample Output #1 2 14 count2 += 1 15 for n in range (nl,n2): if(n%5==0 and n%9==0): 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 16 Sample Output #2 17 count3 += 1 18 print("Number of integers that satisfy A from "+str(n1)+" to "+str(n2)+": "+str(count1)); 19 print("Number of integers that satisfy B from "+str(nl)+" to "+str(n2)+": "+str(count2)); 20 print("Number of integers that satisfy C from "+str(n1)+" to "+str(n2)+": "+str(count3)); 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 "/>
Extracted text: Submitted Code Ask for two user inputs n1 and n2. Keep asking for inputs until conditions below are satisfied. n1 and n2 must be positive integers. n1 should be less than n2. Language: Python 3 P Open in editor Then print the following: 1 while(True): Condition 1: all numbers bet. nl and n2 that are divisible by 7 and not divisible by 3 Condition 2: all numbers bet. n1 and n2 that are divisible by 5 nl=int (input("Enter nl: ")); n2=int(input("Enter n2: ")); if(nl>0 and n2>0 and n2>nl): break; print("Invalid input."); 2 3 4 Condition 3: all numbers bet. n1 and n2 that are divisible by 5 and divisible by 9 5 Sample Input #2 7 #initialize variables 8 countl,count2, count3=0,0,0; 9 for n in range (nl,n2): if(n%7==0 and n%3!=0): countl += 1 12 for n in range (nl,n2): if(n%5==0): Sample Input #1 1 1 10 46 11 1 1 13 Sample Output #1 2 14 count2 += 1 15 for n in range (nl,n2): if(n%5==0 and n%9==0): 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 16 Sample Output #2 17 count3 += 1 18 print("Number of integers that satisfy A from "+str(n1)+" to "+str(n2)+": "+str(count1)); 19 print("Number of integers that satisfy B from "+str(nl)+" to "+str(n2)+": "+str(count2)); 20 print("Number of integers that satisfy C from "+str(n1)+" to "+str(n2)+": "+str(count3)); 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