- 2

How to find a inverse of a number in python

Finding inverse of number

20th Sep 2019, 3:37 PM
Arjun Reddy
4 Respostas
+ 1
The following piece of code can inverse anything: n=input("Enter your characters:") m=len(n)-1 p="" while m>=0: p+=n[m] m-=1 print((p)) This is the easiest way to do so. hope it helps.
13th Oct 2020, 4:25 AM
Aviroop Banerjee
Aviroop Banerjee - avatar
0
what have you tried so far? can you show us your attempt?
20th Sep 2019, 3:49 PM
Lothar
Lothar - avatar
0
FOLLOW ME👌 n=int(input("Enter number: ")) rev=0 while(n>0): dig=n%10 rev=rev*10+dig n=n//10 print("Reverse of the number: ",rev)
20th Sep 2019, 4:31 PM
KfirWe
KfirWe - avatar
0
I wanted to implement euclidean algorithm in python For ex. 5^(-1)mod18
21st Sep 2019, 5:13 AM
Arjun Reddy