summaryrefslogtreecommitdiff
path: root/progs/a419.py
blob: 1af51892a86b81adf4431a54c2da5da92801a092 (plain)
1
2
3
4
5
6
7
8
def rev(num):    
    rev_num = 0
    while (num > 0):  
        rev_num = (rev_num * 10 + num % 10) 
        num = num // 10  
    return rev_num  
def check(n):    
    return (2 * rev(n) == n + 1)