I am trying to make a code (in python) where I can input a range and it will find the sum off all the numbers besides the ones that are divisible by x (which i also choose).
For example:
if the range is 0<N<10
and x = 3
then I want the code to sum the numbers
1 + 2 + 4 + 5 + 7 + 8
and output 27.
or if the range is 0<N<5
and x = 2
I want the code to sum the numbers
1 + 3
and output 4
But, the problem is I have no idea how to do it. Can anyone help me?