Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- down=int(input()) # the lower limit of range
- up=int(input()) # the upper limit of range
- number1=int(input()) # the first divisor
- number2=int(input()) # the second divisor
- count=0 # nr of solutions
- summ=0 # sum of the solutions
- for i in range(down,up+1):
- if i%number1==0 and i%number2!=0:
- count+=1
- summ+=i
- print('Number of solutions=',count)
- print('Sum of solutions=',summ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement