From 435b90f20b2e05a26997d38d0c3e60ecb170d5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=96Ayushsingh07?= <78909117+Ayushsingh07@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:03:53 +0530 Subject: [PATCH] Create inverseofanum.py to find the inverse of a number --- inverseofanum.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 inverseofanum.py diff --git a/inverseofanum.py b/inverseofanum.py new file mode 100644 index 0000000..002c58a --- /dev/null +++ b/inverseofanum.py @@ -0,0 +1,9 @@ +a=int(input()) +i=0 +j=1 +while(a>0): + d=int(a%10) + a=int(a/10) + i+=j*(10**d-1) + j+=1 +print(i) \ No newline at end of file