Question: . { REF: Code Abbey } Print all integers , such as is divisible by x and not by y, where 1 < < <
. { REF: Code Abbey } Print all integers , such as is divisible by x and not by y, where 1 < < < 100000 You might also assume that < and is not divisible by . Test your code with 2 sets of numbers:
(1) First set: [n=7, x=2, y=4] you should obtain 2, 6 as result
(2) Second set: [n=35, x=5, y=12] you should obtain 5, 10, 15, 20, 25, and 30
# Your job is to verify the following solution:
n=int(input("Enter n (upper range) n="))
x=int(input("Enter x, divisor n (factor) x="))
y=int(input("Enter y, no divisor (no factor) y=")) # Verify if x<100000 and x is not divisible by y
if x for i in range(1,n): if i%x==0 and i%y!==0 print(i, end=,' ')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
