Question: I want a simple function that returns a mod of a number but in case of n%n I want value n instead of 0.

my function goes:

```
def special_mod(m,n):
    if  m%n != 0:
        return m%n
    else 
        return n

```

**What I really want is a single line logic that does not include conditions.**
*FYI : (m+1)%n , m%(n+1) will not work for all inputs( my inputs)*

Logically I want something like this 

1. original mod : 0 1 2 3 4 5 (for n =6) that i do not like
2. my special mod : 6 1 2 3 4 5 (for n =6) the cycle value goes to
6 after 5 and 1 after 6

Can this be implemented without using condition like m!=n ?

Answer: 
Any reason: `(m-1)%n+1` wouldn't work, e.g.:

```
>>> n = 6
>>> [(m-1)%n+1 for m in range(12)]
[6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5]

```
`m%n or n` or `(m-1)%n+1` will do the trick.