def rotations(num):
    str_num = str(num)
result = set()
for mid in range(len(str_num)):
    rot = str_num[mid:] + str_num[:mid]
if rot in result:
    return result
else:
    result.add(rot)
return result
Pythonic способ генерировать повороты строк