- 2
How to find a inverse of a number in python
Finding inverse of number
4 Answers
+ 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.
0
what have you tried so far? can you show us your attempt?
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)
0
I wanted to implement euclidean algorithm in python
For ex. 5^(-1)mod18