Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mabna8(n):
- if n==0:
- return 0
- if n==1:
- return 1
- if n==10:
- return 2
- if n==11:
- return 3
- if n==100:
- return 4
- if n==101:
- return 5
- if n==110:
- return 6
- if n==111:
- return 7
- n=int(input())
- a=n
- b=0
- while a!=0:
- a=a//10
- b=b+1
- c=0
- for i in range(n//3+1):
- d=n//1000**i%1000
- e=mabna8(d)
- c=c+e*10**i
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement