```
class Solution:
def reverse(self, x):
""" We create the reversed integer using the modulo operator :)
:type x: int
:rtype: int
"""
r = 0
i = abs( x )
while i != 0:
r = r * 10 + i % 10
i = i // 10
if x < 0:
r = -r
if r < -2147483648 or 2147483647 < r:
return 0
return r
```